[6.7.0][地图sdk] 修正地图sdk崩溃

This commit is contained in:
renwj
2024-10-30 21:15:33 +08:00
parent c3ed29f29e
commit 2a4908582f
3 changed files with 52 additions and 34 deletions

View File

@@ -83,7 +83,7 @@ MOGO_TELEMATIC_VERSION=1.4.7.42
MOGO_SKIN_VERSION=1.4.7.49.18-debug
######## MogoAiCloudSDK Version ########
# 自研地图
MAP_SDK_VERSION=3.4.1.21
MAP_SDK_VERSION=3.4.1.22
MAP_SDK_DATA_VERSION=1.0.0.9
MAP_SDK_OPERATION_VERSION=1.1.4.1
# websocket

View File

@@ -199,35 +199,6 @@ class AMapViewWrapper(mMapView: MapAutoView) : IMogoMapView, IMogoMapUIControlle
override fun onMapLoaded() {
i(M_MAP + TAG, "onMapLoaded: ")
if (checkAMapView()) {
val hdVisibleArray = arrayListOf(
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.building.type,
HDTypes.streetLight.type,
HDTypes.area.type,
HDTypes.regional.type,
HDTypes.geometricLinear.type,
HDTypes.geometricSurface.type,
HDTypes.poi.type
)
if (AppIdentityModeUtils.isTaxiPassenger(
FunctionBuildConfig.appIdentityMode
)
) {
hdVisibleArray.add(HDTypes.CABLE.type)
hdVisibleArray.add(HDTypes.SIGNAL_LINE.type)
}
mMapView.getMapAutoViewHelper()?.setHDTypeVisible(hdVisibleArray.toIntArray())
loadPreVehicleModel()
}
}

View File

@@ -2,15 +2,18 @@ package com.mogo.map
import android.content.Context
import android.util.AttributeSet
import android.util.Log
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HdMapBuildConfig
import com.mogo.eagle.core.data.enums.Carmodel.T2
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.zhidaoauto.map.sdk.inner.abs.IMapController
import com.zhidaoauto.map.sdk.inner.abs.IMarkerController
import com.zhidaoauto.map.sdk.open.abs.view.IMapStyleParams
import com.zhidaoauto.map.sdk.open.renders.marker.Marker
import com.zhidaoauto.map.sdk.open.renders.marker.MarkerOptions
import com.zhidaoauto.map.sdk.open.view.HDTypes
import com.zhidaoauto.map.sdk.open.view.MapAutoView
class MoGoAutoView: MapAutoView {
@@ -24,6 +27,44 @@ class MoGoAutoView: MapAutoView {
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
init {
Log.d(TAG, "--- MoGoAutoView --- init --")
val hdVisibleArray = arrayListOf(
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.building.type,
HDTypes.streetLight.type,
HDTypes.area.type,
HDTypes.regional.type,
HDTypes.geometricLinear.type,
HDTypes.geometricSurface.type,
HDTypes.poi.type
)
if (AppIdentityModeUtils.isTaxiPassenger(
FunctionBuildConfig.appIdentityMode
)
) {
hdVisibleArray.add(HDTypes.CABLE.type)
hdVisibleArray.add(HDTypes.SIGNAL_LINE.type)
}
getMapStyleParams()?.also {
Log.d(TAG, "--- MoGoAutoView --- init 1 --")
it.setHDVisibileArray(hdVisibleArray.toIntArray())
}
}
override fun getMarkerController(mapController: IMapController): IMarkerController {
return MarkerControllerWrapper(super.getMarkerController(mapController))
}
@@ -31,8 +72,9 @@ class MoGoAutoView: MapAutoView {
private class MarkerControllerWrapper(private val controller: IMarkerController): IMarkerController by controller {
override fun addSelfCar(markerOptions: MarkerOptions): Marker? {
Logger.d(TAG, "addSelfCar-> ${HdMapBuildConfig.currentCarVrIconRes}")
Log.d(TAG, "addSelfCar-> ${HdMapBuildConfig.currentCarVrIconRes}")
if (HdMapBuildConfig.currentCarVrIconRes == T2.rawValue) {
Log.d(TAG, "addSelfCar-> T2 --")
markerOptions.scale = 1.05f
}
return controller.addSelfCar(markerOptions)
@@ -41,13 +83,18 @@ class MoGoAutoView: MapAutoView {
override fun onAttachedToWindow() {
super.onAttachedToWindow()
Logger.d(TAG, "-- onAttachedToWindow --")
Log.d(TAG, "-- onAttachedToWindow --")
CallerMapUIServiceManager.getOverlayManager()?.clear()
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
Logger.d(TAG, "-- onDetachedFromWindow --")
Log.d(TAG, "-- onDetachedFromWindow --")
CallerMapUIServiceManager.getOverlayManager()?.clear()
}
override fun onDestroy() {
super.onDestroy()
Log.d(TAG, "--- onDestroy() ---")
}
}