增加了Marker长连接的绑定
This commit is contained in:
@@ -23,8 +23,8 @@ public class MogoApplication extends AbsMogoApplication {
|
|||||||
super.onCreate();
|
super.onCreate();
|
||||||
// MogoModulePaths.addModule( new MogoModule( DemoConstants.TAG, "CARD_DEMO" ) );
|
// MogoModulePaths.addModule( new MogoModule( DemoConstants.TAG, "CARD_DEMO" ) );
|
||||||
// MogoModulePaths.addModule( new MogoModule( Demo2Constants.TAG, "CARD_DEMO2" ) );
|
// MogoModulePaths.addModule( new MogoModule( Demo2Constants.TAG, "CARD_DEMO2" ) );
|
||||||
MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, "CARD_TYPE_ROAD_CODITION" ) );
|
|
||||||
MogoModulePaths.addModule(new MogoModule(OnLineCarConstants.TAG, "CARD_TYPE_ROAD_ONLINECAR"));
|
MogoModulePaths.addModule(new MogoModule(OnLineCarConstants.TAG, "CARD_TYPE_ROAD_ONLINECAR"));
|
||||||
|
MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, "CARD_TYPE_ROAD_CODITION" ) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import com.mogo.module.main.cards.MogoModulesHandler;
|
|||||||
import com.mogo.module.main.cards.MogoModulesManager;
|
import com.mogo.module.main.cards.MogoModulesManager;
|
||||||
import com.mogo.module.main.cards.OrientedViewPager;
|
import com.mogo.module.main.cards.OrientedViewPager;
|
||||||
import com.mogo.module.main.cards.VerticalStackTransformer;
|
import com.mogo.module.main.cards.VerticalStackTransformer;
|
||||||
|
import com.mogo.module.service.MarkerServiceHandler;
|
||||||
import com.mogo.module.service.ServiceConst;
|
import com.mogo.module.service.ServiceConst;
|
||||||
import com.mogo.service.MogoServicePaths;
|
import com.mogo.service.MogoServicePaths;
|
||||||
import com.mogo.service.connection.IMogoSocketManager;
|
import com.mogo.service.connection.IMogoSocketManager;
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.mogo.module.service;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.alibaba.android.arouter.launcher.ARouter;
|
||||||
|
import com.mogo.map.marker.IMogoMarkerManager;
|
||||||
|
import com.mogo.module.service.entity.MarkerResponse;
|
||||||
|
import com.mogo.service.MogoServicePaths;
|
||||||
|
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||||
|
import com.mogo.service.connection.IMogoSocketManager;
|
||||||
|
import com.mogo.service.imageloader.IMogoImageloader;
|
||||||
|
import com.mogo.service.map.IMogoMapService;
|
||||||
|
import com.mogo.utils.logger.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* author : donghongyu
|
||||||
|
* e-mail : 1358506549@qq.com
|
||||||
|
* date : 2020-01-0718:54
|
||||||
|
* desc : 持有服务接口实例
|
||||||
|
* version: 1.0
|
||||||
|
*/
|
||||||
|
public class MarkerServiceHandler {
|
||||||
|
|
||||||
|
private static IMogoMapService mMapService;
|
||||||
|
private static IMogoMarkerManager mMarkerManager;
|
||||||
|
private static IMogoImageloader mImageloader;
|
||||||
|
private static IMogoSocketManager mMogoSocketManager;
|
||||||
|
|
||||||
|
public static void init(Context context) {
|
||||||
|
mMapService = (IMogoMapService) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_MAP).navigation(context);
|
||||||
|
mImageloader = (IMogoImageloader) ARouter.getInstance().build(MogoServicePaths.PATH_UTILS_IMAGE_LOADER).navigation(context);
|
||||||
|
mMarkerManager = mMapService.getMarkerManager(context);
|
||||||
|
|
||||||
|
mMogoSocketManager = (IMogoSocketManager) ARouter.getInstance().build(MogoServicePaths.PATH_SOCKET_MANAGER).navigation();
|
||||||
|
mMogoSocketManager.registerOnMessageListener(401001, new IMogoOnMessageListener<MarkerResponse>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<MarkerResponse> target() {
|
||||||
|
return MarkerResponse.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMsgReceived(MarkerResponse obj) {
|
||||||
|
Logger.e("",obj.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IMogoMapService getMapService() {
|
||||||
|
return mMapService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IMogoMarkerManager getMarkerManager() {
|
||||||
|
return mMarkerManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IMogoImageloader getImageloader() {
|
||||||
|
return mImageloader;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IMogoSocketManager getMogoSocketManager() {
|
||||||
|
return mMogoSocketManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -204,6 +204,9 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
|||||||
mUiController = mMogoMapService.getMapUIController();
|
mUiController = mMogoMapService.getMapUIController();
|
||||||
mStatusManager = ( IMogoStatusManager ) ARouter.getInstance().build( MogoServicePaths.PATH_STATUS_MANAGER ).navigation( context );
|
mStatusManager = ( IMogoStatusManager ) ARouter.getInstance().build( MogoServicePaths.PATH_STATUS_MANAGER ).navigation( context );
|
||||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.USER_INTERACTED, this );
|
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.USER_INTERACTED, this );
|
||||||
|
|
||||||
|
//TODO 初始化地图地图绘制大而全的Marker
|
||||||
|
MarkerServiceHandler.init(mContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -47,4 +47,13 @@ public class MarkerResponse {
|
|||||||
mSign = sign;
|
mSign = sign;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "MarkerResponse{" +
|
||||||
|
"mCode=" + mCode +
|
||||||
|
", mMsg='" + mMsg + '\'' +
|
||||||
|
", mResult=" + mResult +
|
||||||
|
", mSign='" + mSign + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user