[dev_arch_opt_3.0]
[Change] [ 1、修改底盘数据Gnss回调为定位回调 2、增加WGS84转GCJ02高德坐标系方法 3、增加底盘数据转换为GCJ02坐标系后的回调 ] Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/12/9
|
||||
*
|
||||
* 地图实例构建
|
||||
*/
|
||||
public interface IMogoMapApiBuilder extends IProvider {
|
||||
|
||||
IMogoLocationClient getLocationClient( Context context );
|
||||
|
||||
IMogoMapUIController getMapUIController();
|
||||
|
||||
void destroy();
|
||||
|
||||
IMogoMapView getMapView( Context context );
|
||||
|
||||
}
|
||||
@@ -2,13 +2,11 @@ package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.location.ALocationClient;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.uicontroller.AMapUIController;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -16,66 +14,40 @@ import com.zhidaoauto.map.sdk.open.view.MapAutoView;
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
@Route(path = MapApiPath.PATH)
|
||||
public class CustomMapApiBuilder implements IMogoMapApiBuilder {
|
||||
public class CustomMapApiBuilder {
|
||||
|
||||
private static final String TAG = "CustomMapApiBuilder";
|
||||
|
||||
@Override
|
||||
private static CustomMapApiBuilder sApiBuilder;
|
||||
|
||||
private static CustomMapApiBuilder getApiBuilder() {
|
||||
if (sApiBuilder == null) {
|
||||
synchronized (CustomMapApiBuilder.class) {
|
||||
if (sApiBuilder == null) {
|
||||
CallerLogger.INSTANCE.d(TAG, "init");
|
||||
sApiBuilder = new CustomMapApiBuilder();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sApiBuilder;
|
||||
}
|
||||
|
||||
public IMogoLocationClient getLocationClient(Context context) {
|
||||
return new ALocationClient(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapUIController getMapUIController() {
|
||||
return AMapUIController.getInstance();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IMogoMapView getMapView(Context context) {
|
||||
// MapParams mapParams = MapParams.Companion.init();
|
||||
// mapParams.setDebugMode(false)
|
||||
// //todo 1-使用本地地图数据,0-使用在线地图数据
|
||||
// //.setDataFileSource(1)
|
||||
// .setCoordinateType(MapParams.COORDINATETYPE_GCJ02)
|
||||
// .setPerspectiveMode(MapParams.MAP_PERSPECTIVE_3D)
|
||||
// .setHDVisibileArray(new int[]{HDTypes.DIVIDER.type,
|
||||
// HDTypes.ROAD_AREA.type,
|
||||
// HDTypes.STOP_LINE.type,
|
||||
// HDTypes.ARROW.type,
|
||||
// HDTypes.STATION_BRIDGE.type,
|
||||
// HDTypes.ZEBRA_LINE.type,
|
||||
// HDTypes.GREEN_BELT.type,
|
||||
// HDTypes.DIVERSION.type,
|
||||
// HDTypes.SAFE_ISLAND.type,
|
||||
// HDTypes.ALPHANUMERIC.type,
|
||||
// HDTypes.GUARDBAR.type,
|
||||
// HDTypes.TRAFFIC_DEVICE.type,
|
||||
// HDTypes.CABLE.type,
|
||||
// HDTypes.SIGNAL_LINE.type})
|
||||
// // .setZoom( 20 )
|
||||
// // .setPointToCenter( 0.734375f, 0.5f )
|
||||
// //todo 2D模式下需要注意ADAS部分遮挡
|
||||
// //.setPointToCenter(0.5f, 0.5f)
|
||||
// // 根据 FunctionBuildConfig 配置的皮肤样式设置题图的样式
|
||||
// .setStyleMode(FunctionBuildConfig.skinMode == 0 ? MapParams.MAP_STYLE_NIGHT_VR : MapParams.MAP_STYLE_DAY_VR);
|
||||
//
|
||||
// MapAutoApi.INSTANCE.init(context, mapParams);
|
||||
//
|
||||
MapAutoView mapAutoView = new MapAutoView(context);
|
||||
//mapAutoView.registerRenderListener(l -> Log.i(TAG, "renderTime: " + l));
|
||||
IMogoMapView mapView = new AMapViewWrapper(mapAutoView);
|
||||
return mapView;
|
||||
public static IMogoLocationClient getLocationClientDelegate(Context context) {
|
||||
return getApiBuilder().getLocationClient(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
|
||||
public static IMogoMapUIController getMapUIControllerDelegate() {
|
||||
return getApiBuilder().getMapUIController();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
CallerLogger.INSTANCE.d(TAG, "init");
|
||||
public static void destroy() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@ package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.map.location.MogoLocationListenerRegister;
|
||||
|
||||
/**
|
||||
@@ -17,7 +17,7 @@ public class MogoLocationClient implements IMogoLocationClient {
|
||||
private static volatile MogoLocationClient sInstance;
|
||||
|
||||
public MogoLocationClient( Context context ) {
|
||||
mDelegate = MogoMapDelegateFactory.getLocationClientDelegate( context );
|
||||
mDelegate = CustomMapApiBuilder.getLocationClientDelegate( context );
|
||||
}
|
||||
|
||||
public static MogoLocationClient getInstance( Context context ) {
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/17
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
class MogoMapDelegateFactory {
|
||||
|
||||
private static final String TAG = "MogoMapDelegateFactory";
|
||||
|
||||
private static IMogoMapApiBuilder sApiBuilder;
|
||||
|
||||
private static IMogoMapApiBuilder getApiBuilder() {
|
||||
if (sApiBuilder == null) {
|
||||
synchronized (MogoMapDelegateFactory.class) {
|
||||
if (sApiBuilder == null) {
|
||||
sApiBuilder = ARouter.getInstance().navigation(IMogoMapApiBuilder.class);
|
||||
}
|
||||
}
|
||||
}
|
||||
return sApiBuilder;
|
||||
}
|
||||
|
||||
public static IMogoLocationClient getLocationClientDelegate(Context context) {
|
||||
return getApiBuilder().getLocationClient(context);
|
||||
}
|
||||
|
||||
public static IMogoMapUIController getMapUIControllerDelegate() {
|
||||
return getApiBuilder().getMapUIController();
|
||||
}
|
||||
|
||||
public static void destroy() {
|
||||
getApiBuilder().destroy();
|
||||
}
|
||||
|
||||
public static IMogoMapView getMapView(Context context) {
|
||||
return getApiBuilder().getMapView(context);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
|
||||
private void initDelegate() {
|
||||
if (mDelegate == null) {
|
||||
mDelegate = MogoMapDelegateFactory.getMapUIControllerDelegate();
|
||||
mDelegate = CustomMapApiBuilder.getMapUIControllerDelegate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.widget.FrameLayout;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -33,27 +34,24 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
private boolean mIsVrMode = false;
|
||||
private MapAutoView mapAutoView;
|
||||
|
||||
@Override
|
||||
protected void addMapView(Context context) {
|
||||
mMapView = MogoMapDelegateFactory.getMapView(context);
|
||||
if (mMapView != null) {
|
||||
if (mapAutoView == null) {
|
||||
mapAutoView = new MapAutoView(context);
|
||||
}
|
||||
if (mMapView == null) {
|
||||
mMapView = new AMapViewWrapper(mapAutoView);
|
||||
final View mapView = mMapView.getMapView();
|
||||
if (mapView != null) {
|
||||
addView(mapView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
} else {
|
||||
CallerLogger.INSTANCE.e(TAG, "create MapView instance failed.");
|
||||
}
|
||||
} else {
|
||||
CallerLogger.INSTANCE.e(TAG, "create IMogoMapView instance failed.");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isVrMode() {
|
||||
return mIsVrMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
|
||||
Reference in New Issue
Block a user