From eced61bb52eefad1585b769df782dd06e1aabaf1 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Tue, 26 Nov 2024 19:03:36 +0800 Subject: [PATCH] =?UTF-8?q?[6.8.0][Fix]=E8=A7=A3=E5=86=B3=E9=AB=98?= =?UTF-8?q?=E5=BE=B7=E5=9C=B0=E5=9B=BE=E8=B5=B7=E7=BB=88=E7=82=B9=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E7=BB=98=E5=88=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/function/view/TravelRealityView.kt | 53 ++++++++++--------- 1 file changed, 29 insertions(+), 24 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 8f23653e39..95fc9a92a7 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 @@ -149,6 +149,7 @@ class TravelRealityView @JvmOverloads constructor( @Volatile private var isMapDestroyed = false + @Volatile private var ochType = -1 @@ -263,6 +264,7 @@ class TravelRealityView @JvmOverloads constructor( private var mEndLatLng: LatLng? = null // Bus会用到 + @Volatile private var mSmallSiteList: List? = null // Bus有起终点和途经站点 @@ -392,9 +394,10 @@ class TravelRealityView @JvmOverloads constructor( handleGlobalPath(globalPath) requestData(globalPath as ArrayList) } - if (!isRoadTrackReq) { + // 功能下线 + /*if (!isRoadTrackReq) { handleRoadTrajectories(roadTrackList, globalPath) - } + }*/ } } @@ -412,6 +415,7 @@ class TravelRealityView @JvmOverloads constructor( what = CLEAR_ALL_DATA nonFrequentHandler?.sendMessage(this) } + mSiteList.clear() } private fun initView(context: Context) { @@ -641,7 +645,8 @@ class TravelRealityView @JvmOverloads constructor( super.onAttachedToWindow() CallerLogger.d("$M_MAP$TAG", "onAttachedToWindow") initHandlers() - advanceRequest() + // 功能下线 + // advanceRequest() CallerPlanningRottingListenerManager.addListener("${TAG}${this.hashCode()}", this) // 注册定位监听 CallerChassisLocationGCJ02ListenerManager.addListener("${TAG}${this.hashCode()}", this) @@ -1476,10 +1481,11 @@ class TravelRealityView @JvmOverloads constructor( handleGlobalPath(pointList) requestData(pointList) - if (!isRoadTrackReq) { + // 功能下线 + /*if (!isRoadTrackReq) { CallerLogger.d("$M_MAP$TAG", "处理智慧道路轨迹!") handleRoadTrajectories(roadTrackList, pointList) - } + }*/ } } } @@ -1501,6 +1507,7 @@ class TravelRealityView @JvmOverloads constructor( super.onAutopilotRouteLineId(lineId) if (lineId == 0L) { this.globalPathResp = null + mSmallSiteList = null UiThreadHandler.post { clearPolyline() } @@ -1736,9 +1743,9 @@ class TravelRealityView @JvmOverloads constructor( } } else if (ochInfo.type == 1) { val siteDataList = ochInfo.siteMarkerList + val markerOptionsList: ArrayList = ArrayList() siteDataList?.let { siteList -> - val markerOptionsList: ArrayList = ArrayList() - siteList.forEach { it -> + siteList.forEach { markerOptionsList.add(MarkerOptions().apply { position(LatLng(it.latLng.lat!!, it.latLng.lon!!)) anchor(it.anchorX, it.anchorY) @@ -1754,12 +1761,12 @@ class TravelRealityView @JvmOverloads constructor( ) } mSmallSiteList = siteDataList - if (!isPlayingAnim) { + } + if (!isPlayingAnim) { + drawSiteMarkers(markerOptionsList) + } else { + UiThreadHandler.post { drawSiteMarkers(markerOptionsList) - } else { - UiThreadHandler.post { - drawSiteMarkers(markerOptionsList) - } } } } @@ -1843,6 +1850,7 @@ class TravelRealityView @JvmOverloads constructor( } } } else { + // 空集合就是清除逻辑 Message.obtain().apply { what = DRAW_SITE_MARKERS obj = markerOptionsList @@ -2240,18 +2248,15 @@ class TravelRealityView @JvmOverloads constructor( private fun realDrawSiteMarkers(options: ArrayList) { CallerLogger.d("$M_MAP$TAG", "realDrawSiteMarkers") - if (options.isEmpty()) { - siteMarkerList.forEach { - it.destroy() - } - siteMarkerList.clear() - } else { - options.forEach { - mAMap?.let { map -> - siteMarkerList.add(map.addMarker(it).also { marker -> - marker.isClickable = false - }) - } + siteMarkerList.forEach { + it.destroy() + } + siteMarkerList.clear() + options.forEach { + mAMap?.let { map -> + siteMarkerList.add(map.addMarker(it).also { marker -> + marker.isClickable = false + }) } } }