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 + }) } } }