diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt index 4afc267134..bb416ca33d 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt @@ -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) {