[3.4.0-map-sdk] wait to finish

This commit is contained in:
zhongchao
2023-08-25 10:16:15 +08:00
parent db342e0bfc
commit 7865da2347
40 changed files with 404 additions and 648 deletions

View File

@@ -11,7 +11,11 @@ import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.zhidaoauto.map.sdk.open.HDTypes;
import com.zhidaoauto.map.sdk.open.MapParams;
import com.zhidaoauto.map.sdk.open.view.MapAutoView;
import com.zhidaoauto.map.sdk.open.view.MapStyleParams;
/**
@@ -39,9 +43,39 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
private MapAutoView mapAutoView;
@Override
protected void addMapView(Context context) {
protected void addMapView(Context context, AttributeSet attrs) {
if (mapAutoView == null) {
mapAutoView = new MapAutoView(context);
if (getStyleParams() == null) {
mapAutoView = new MapAutoView(context, attrs);
} else {
mapAutoView = new MapAutoView(context, getStyleParams());
}
}
//基础统一配置,如果各个样式地图有修改,此处需要改动
if (mapAutoView.getMapStyleParams() != null) {
mapAutoView.getMapStyleParams()
.setIsWeatherEnable(false)
.setPerspectiveMode(MapParams.MAP_PERSPECTIVE_UP_CAR)
.setHDVisibileArray(new int[]{HDTypes.DIVIDER.getType(), //onSurfaceCreate设置
HDTypes.ROAD_AREA.getType(),
HDTypes.STOP_LINE.getType(),
HDTypes.ARROW.getType(),
HDTypes.STATION_BRIDGE.getType(),
HDTypes.ZEBRA_LINE.getType(),
HDTypes.GREEN_BELT.getType(),
HDTypes.DIVERSION.getType(),
HDTypes.SAFE_ISLAND.getType(),
HDTypes.ALPHANUMERIC.getType(),
HDTypes.GUARDBAR.getType(),
HDTypes.TRAFFIC_DEVICE.getType(),
HDTypes.CABLE.getType(),
HDTypes.SIGNAL_LINE.getType(),
HDTypes.building.getType(),
HDTypes.streetLight.getType(),
HDTypes.area.getType(),
HDTypes.regional.getType(),
HDTypes.geometricLinear.getType(),
HDTypes.geometricSurface.getType()});
}
if (mMapView == null) {
mMapView = new AMapViewWrapper(mapAutoView);
@@ -54,6 +88,20 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
}
}
/**
* 子类实现
* 代码StyleParams和XML初始化设置同时仅支持一种
*
* @return MapStyleParams
*/
protected MapStyleParams getStyleParams() {
return null;
}
protected IMogoMapUIController getUIController(){
return mMapView.getMap().getUIController();
}
@Override
protected String getInstanceTag() {
return MogoMap.DEFAULT;

View File

@@ -5,6 +5,7 @@ import com.mogo.eagle.core.data.map.*
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.function.call.map.*
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.map.MogoMap.Companion.DEFAULT
import com.mogo.map.overlay.point.Point.Options
import com.mogo.map.MogoMap.Companion.mapInstance
import com.mogo.map.overlay.core.*
@@ -20,7 +21,7 @@ internal class MoGoOverlayManagerImpl: IMoGoOverlayManager {
private val lines by lazy { ConcurrentHashMap<Polyline, IMapPolylineOverlay>() }
override fun showOrUpdatePoint(options: Options): Point? {
override fun showOrUpdatePoint(options: Options, mapTag:String): Point? {
synchronized(points) {
val key = Point(options.id, options.owner, options.level, options)
var point = points[key]
@@ -29,7 +30,7 @@ internal class MoGoOverlayManagerImpl: IMoGoOverlayManager {
point.setOptions(options)
return key
} else {
val p = mapInstance.getMogoMap().addPoint(options)
val p = mapInstance.getMogoMap(mapTag).addPoint(options)
if (p != null) {
p.onRemove { removed ->
val keys = points.filterKeys { it.id == removed }
@@ -223,7 +224,7 @@ internal class MoGoOverlayManagerImpl: IMoGoOverlayManager {
}
}
override fun showOrUpdateLine(options: Polyline.Options): Polyline? {
override fun showOrUpdateLine(options: Polyline.Options,mapTag:String): Polyline? {
synchronized(lines) {
val key = Polyline(options.id, options.owner, options.level, options)
var line = lines[key]
@@ -232,7 +233,7 @@ internal class MoGoOverlayManagerImpl: IMoGoOverlayManager {
line.setOptions(options)
return key
} else {
val newLine = mapInstance.getMogoMap().addLine(options)
val newLine = mapInstance.getMogoMap(mapTag).addLine(options)
if (newLine != null) {
newLine.onRemove { removed ->
val keys = lines.filterKeys { it.id == removed }