Files
MoGoEagleEye/libraries/mogo-map/src/main/java/com/mogo/map/CustomMapApiBuilder.java
donghongyu 5e1fc494ae [2.13.0]
[Change]
[1、修改地图MapParams初始化位置到MogoApplication中,但是没有生效,需要贾郭峰看下]

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
2022-12-09 11:07:09 +08:00

108 lines
3.8 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.mogo.map;
import android.content.Context;
import android.util.Log;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
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.search.GeocodeSearchClient;
import com.mogo.map.search.PoiSearchClient;
import com.mogo.map.search.geo.IMogoGeoSearch;
import com.mogo.map.search.poisearch.IMogoPoiSearch;
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
import com.mogo.map.search.traffic.IMogoTrafficSearch;
import com.mogo.map.uicontroller.AMapUIController;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.zhidaoauto.map.sdk.open.HDTypes;
import com.zhidaoauto.map.sdk.open.MapAutoApi;
import com.zhidaoauto.map.sdk.open.MapParams;
import com.zhidaoauto.map.sdk.open.view.MapAutoView;
/**
* @author congtaowang
* @since 2020/12/9
* <p>
* 描述
*/
@Route(path = MapApiPath.PATH)
public class CustomMapApiBuilder implements IMogoMapApiBuilder {
private static final String TAG = "CustomMapApiBuilder";
@Override
public IMogoGeoSearch getGeoSearch(Context context) {
return new GeocodeSearchClient(context);
}
@Override
public IMogoLocationClient getLocationClient(Context context) {
return new ALocationClient(context);
}
@Override
public IMogoMapUIController getMapUIController() {
return AMapUIController.getInstance();
}
@Override
public IMogoPoiSearch getPoiSearchClient(Context context, MogoPoiSearchQuery query) {
return new PoiSearchClient(context, query);
}
@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;
}
@Override
public IMogoTrafficSearch getTrafficSearch() {
return null;
}
@Override
public void destroy() {
}
@Override
public void init(Context context) {
CallerLogger.INSTANCE.d(TAG, "init");
}
}