[6.8.0][Fix]解决高德地图起终点重复绘制的问题
This commit is contained in:
@@ -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<SiteMarkerBean>? = null
|
||||
|
||||
// Bus有起终点和途经站点
|
||||
@@ -392,9 +394,10 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
handleGlobalPath(globalPath)
|
||||
requestData(globalPath as ArrayList<Point>)
|
||||
}
|
||||
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<MarkerOptions> = ArrayList()
|
||||
siteDataList?.let { siteList ->
|
||||
val markerOptionsList: ArrayList<MarkerOptions> = 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<MarkerOptions>) {
|
||||
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
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user