From d0a614cb555ee5676a09c4569b437ac74426c84f Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Wed, 9 Oct 2024 16:18:28 +0800 Subject: [PATCH] =?UTF-8?q?[6.7.0][Opt]=E4=BC=98=E5=8C=96=E9=AB=98?= =?UTF-8?q?=E5=BE=B7=E5=9C=B0=E5=9B=BE=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/function/view/TravelRealityView.kt | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) 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()