diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/TravelRealityView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/TravelRealityView.kt index e1c095aa4a..d37a500d9c 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/TravelRealityView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/TravelRealityView.kt @@ -227,6 +227,7 @@ class TravelRealityView @JvmOverloads constructor( @Volatile private var isSmallMap: Boolean = true private var iconRes = R.drawable.small_map_car + @Volatile private var globalPathResp: MessagePad.GlobalPathResp? = null private val mCoordinatesLatLng: MutableList = ArrayList() private var mSmallCarMarker: Marker? = null @@ -324,13 +325,22 @@ class TravelRealityView @JvmOverloads constructor( } // 显示小地图样式 changeMapSettings(true) + globalPathResp?.let { + if (it.wayPointsList.size > 0) { + drawRotting() + } + } } else { clearPolyline() hideSmallCarMarker() // 显示行程总览地图样式 changeMapSettings(false) + val globalPath = reqData + if (!globalPath.isNullOrEmpty()) { + requestData(globalPath as ArrayList) + } if (!isRoadTrackReq) { - handleRoadTrajectories(roadTrackList, null) + handleRoadTrajectories(roadTrackList, globalPath) } } } @@ -559,10 +569,6 @@ class TravelRealityView @JvmOverloads constructor( super.onVisibilityChanged(changedView, visibility) if (visibility == VISIBLE) { Log.d(TAG, "onVisibilityChanged:VISIBLE!") - val globalPath: List? = reqData - if (!globalPath.isNullOrEmpty()) { - requestData(globalPath as ArrayList) - } } } @@ -585,6 +591,7 @@ class TravelRealityView @JvmOverloads constructor( // 注册定位监听 CallerChassisLocationGCJ02ListenerManager.removeListener("${TAG}${this.hashCode()}") CallerPlanningRottingListenerManager.removeListener("${TAG}${this.hashCode()}") + CallerAutoPilotStatusListenerManager.removeListener("${TAG}${this.hashCode()}") nonFrequentHandler?.looper?.quitSafely() nonFrequentHandler = null travelNetWorkModel.cancelAllRequest() @@ -1446,6 +1453,16 @@ class TravelRealityView @JvmOverloads constructor( } } + override fun onAutopilotRouteLineId(lineId: Long) { + super.onAutopilotRouteLineId(lineId) + if (lineId == 0L) { + this.globalPathResp = null + UiThreadHandler.post { + clearPolyline() + } + } + } + private fun drawRotting() { globalPathResp?.let { val latLngList: MutableList = ArrayList()