1. 优化小智动画实现
2. 入口按钮添加白天模式的阴影 3. 大而全数据(短链+长链)-> 单独短链 4. 内存优化
This commit is contained in:
@@ -30,6 +30,7 @@ import com.mogo.map.navi.MogoTraffic;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.common.map.MapCenterPointStrategy;
|
||||
import com.mogo.module.common.map.Scene;
|
||||
import com.mogo.module.service.intent.IntentHandlerFactory;
|
||||
@@ -224,9 +225,10 @@ public class MogoServices implements IMogoMapListener,
|
||||
/**
|
||||
* 手动刷新回调
|
||||
*/
|
||||
private RefreshCallback mCustomRefreshCallback = new RefreshCallback() {
|
||||
private RefreshCallback mCustomRefreshCallback = new RefreshCallback< MarkerResponse >() {
|
||||
@Override
|
||||
public void onSuccess( Object o ) {
|
||||
public void onSuccess( MarkerResponse o ) {
|
||||
MapMarkerManager.getInstance().onSyncMarkerResponse( o );
|
||||
mLoopRequest = false;
|
||||
// 用户手动操作地图刷新成功后,设置状态为 true,引发延时策略
|
||||
mStatusManager.setUserInteractionStatus( ServiceConst.TYPE, true, true );
|
||||
@@ -241,9 +243,10 @@ public class MogoServices implements IMogoMapListener,
|
||||
/**
|
||||
* 自动刷新回调
|
||||
*/
|
||||
private RefreshCallback mAutoRefreshCallback = new RefreshCallback() {
|
||||
private RefreshCallback mAutoRefreshCallback = new RefreshCallback<MarkerResponse>() {
|
||||
@Override
|
||||
public void onSuccess( Object o ) {
|
||||
public void onSuccess( MarkerResponse o ) {
|
||||
MapMarkerManager.getInstance().onSyncMarkerResponse( o );
|
||||
mLoopRequest = false;
|
||||
Logger.d( TAG, "request Success." );
|
||||
invokeAutoRefreshStrategy();
|
||||
@@ -436,7 +439,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
Logger.w( TAG, "lonLat is null." );
|
||||
return;
|
||||
}
|
||||
mRefreshModel.refreshData( ro.mLonLat, ro.mRadius, ro.mAmount, ro.mCallback );
|
||||
mRefreshModel.refreshExplorerWayData( ro.mLonLat, ro.mRadius, ro.mAmount, ro.mCallback );
|
||||
MapMarkerManager.getInstance().getOnlineCarDataByAutoRefreshStrategy( ro.mLonLat );
|
||||
|
||||
Logger.i( TAG, "刷新半径 = %s, 点 = %s, zoomLevel = %s, amount = %s", ro.mRadius, ro.mLonLat, mLastZoomLevel, ro.mAmount );
|
||||
|
||||
@@ -109,8 +109,8 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
mContext = context.getApplicationContext();
|
||||
mRefreshModel = new RefreshModel( mContext );
|
||||
|
||||
// 长连接
|
||||
MarkerServiceHandler.getMogoSocketManager().registerOnMessageListener( 401001, this );
|
||||
// 长连接 - 长链变短链
|
||||
// MarkerServiceHandler.getMogoSocketManager().registerOnMessageListener( 401001, this );
|
||||
MarkerServiceHandler.getActionManager().registerBizActionDoneListener( this );
|
||||
MarkerServiceHandler.getApis().getRegisterCenterApi().registerADASControlStatusChangedListener( TAG, this );
|
||||
}
|
||||
@@ -703,6 +703,16 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
} );
|
||||
}
|
||||
|
||||
public void onSyncMarkerResponse(MarkerResponse response){
|
||||
if ( ignoreDrawRequest() ) {
|
||||
return;
|
||||
}
|
||||
Logger.d( TAG, "接收到了地图大而全数据" );
|
||||
runOnTargetThread( () -> {
|
||||
drawMapMarker( response );
|
||||
} );
|
||||
}
|
||||
|
||||
public void syncLocation( double lon, double lat ) {
|
||||
mCarLatLng = new MogoLatLng( lat, lon );
|
||||
}
|
||||
|
||||
@@ -110,6 +110,51 @@ public class RefreshModel {
|
||||
}
|
||||
}
|
||||
|
||||
public void refreshExplorerWayData( MogoLatLng latLng, int radius, int limit, final RefreshCallback callback ) {
|
||||
if ( mRefreshApiService != null ) {
|
||||
final Map< String, Object > query = new ParamsProvider.Builder( mContext ).build();
|
||||
final RefreshBody refreshBody = new RefreshBody();
|
||||
refreshBody.limit = limit;
|
||||
refreshBody.location = new RefreshBody.LatLon( latLng.lat, latLng.lng );
|
||||
refreshBody.radius = radius;
|
||||
refreshBody.dataType.add( ServiceConst.CARD_TYPE_ROAD_CONDITION );
|
||||
|
||||
String data = GsonUtil.jsonFromObject( refreshBody );
|
||||
query.put( "data", data );
|
||||
Logger.d( TAG, data );
|
||||
|
||||
|
||||
mRefreshApiService.refreshDataSync( query )
|
||||
.subscribeOn( Schedulers.io() )
|
||||
.observeOn( AndroidSchedulers.mainThread() )
|
||||
.subscribe( new SubscribeImpl< MarkerResponse >( RequestOptions.create( mContext ) ) {
|
||||
@Override
|
||||
public void onSuccess( MarkerResponse o ) {
|
||||
super.onSuccess( o );
|
||||
if ( callback != null ) {
|
||||
callback.onSuccess( o );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError( Throwable e ) {
|
||||
super.onError( e );
|
||||
if ( callback != null ) {
|
||||
callback.onFail();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError( String message, int code ) {
|
||||
super.onError( message, code );
|
||||
if ( callback != null ) {
|
||||
callback.onFail();
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
public void refreshDataSync( MogoLatLng latLng, int radius, int limit, final RefreshCallback callback ) {
|
||||
if ( mRefreshApiService != null ) {
|
||||
final Map< String, Object > query = new ParamsProvider.Builder( mContext ).build();
|
||||
|
||||
Reference in New Issue
Block a user