[6.7.0][Opt]优化高德地图显示
This commit is contained in:
@@ -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<LatLng> = 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<Point>)
|
||||
}
|
||||
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<Point>? = reqData
|
||||
if (!globalPath.isNullOrEmpty()) {
|
||||
requestData(globalPath as ArrayList<Point>)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<MogoLatLng> = ArrayList()
|
||||
|
||||
Reference in New Issue
Block a user