[6.1.0][Opt]调整全览地图视角切换的逻辑
This commit is contained in:
@@ -967,25 +967,25 @@ class OverMapView @JvmOverloads constructor(
|
||||
val boundsBuilder = LatLngBounds.Builder()
|
||||
var isOnlyCarLocation = true
|
||||
|
||||
if (linePointsLatLng != null && linePointsLatLng.size > 1) {
|
||||
// 圈定地图显示范围(自动驾驶轨迹)
|
||||
for (i in linePointsLatLng.indices) {
|
||||
boundsBuilder.include(linePointsLatLng[i])
|
||||
}
|
||||
isOnlyCarLocation = false
|
||||
}
|
||||
|
||||
if (mLocation != null) {
|
||||
// 自车坐标
|
||||
boundsBuilder.include(LatLng(mLocation!!.latitude, mLocation!!.longitude))
|
||||
}
|
||||
|
||||
coordinates?.let {
|
||||
if (!coordinates.isNullOrEmpty()) {
|
||||
// 站点轨迹被包含在地图显示范围内
|
||||
for (i in it.indices) {
|
||||
boundsBuilder.include(it[i])
|
||||
for (i in coordinates.indices) {
|
||||
boundsBuilder.include(coordinates[i])
|
||||
}
|
||||
isOnlyCarLocation = false
|
||||
} else {
|
||||
if (linePointsLatLng != null && linePointsLatLng.size > 1) {
|
||||
// 圈定地图显示范围(自动驾驶轨迹)
|
||||
for (i in linePointsLatLng.indices) {
|
||||
boundsBuilder.include(linePointsLatLng[i])
|
||||
}
|
||||
isOnlyCarLocation = false
|
||||
}
|
||||
}
|
||||
|
||||
if (!isOnlyCarLocation) {
|
||||
|
||||
Reference in New Issue
Block a user