[sweeper]
[部分轨迹不展示]
This commit is contained in:
@@ -36,6 +36,8 @@ class WeltMapOverView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener {
|
||||
private var mRoutePolylines: Polyline?=null
|
||||
// private val mLineMarkers: MutableList<Marker?> = mutableListOf()
|
||||
private var mEndStationMarker: Marker? = null
|
||||
private var mogoDistanceLocationMax: LatLng?=null
|
||||
private var aPointDistanceMax = 0.0F
|
||||
private var mFirst: Boolean = false
|
||||
|
||||
//清扫车任务地图
|
||||
@@ -153,9 +155,27 @@ class WeltMapOverView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener {
|
||||
if (mTaskCoordinatesLatLng.size > 0) {
|
||||
//存放经纬度
|
||||
for (i in mTaskCoordinatesLatLng.indices) {
|
||||
boundsBuilder.include(mTaskCoordinatesLatLng[i])
|
||||
val latLng = mTaskCoordinatesLatLng[i]
|
||||
boundsBuilder.include(latLng)
|
||||
try {
|
||||
val calculateLineDistance = CoordinateUtils.calculateLineDistance(
|
||||
latLng.longitude,
|
||||
latLng.latitude,
|
||||
currentLatLng.latitude,
|
||||
currentLatLng.longitude
|
||||
)
|
||||
if(calculateLineDistance>aPointDistanceMax){
|
||||
aPointDistanceMax = calculateLineDistance
|
||||
mogoDistanceLocationMax = currentLatLng
|
||||
}
|
||||
}catch (e:Exception){
|
||||
CallerLogger.e(TAG,e.stackTrace)
|
||||
}
|
||||
}
|
||||
}
|
||||
mogoDistanceLocationMax?.let {
|
||||
boundsBuilder.include(it)
|
||||
}
|
||||
boundsBuilder.include(currentLatLng)
|
||||
mAMap?.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(), 100, 100, 100, 100))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user