From a3b03725a42d13428f6e7b4bc3311119be0d6bc1 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Mon, 25 Sep 2023 14:17:48 +0800 Subject: [PATCH] =?UTF-8?q?[6.1.0][Opt]=E8=B0=83=E6=95=B4=E5=85=A8?= =?UTF-8?q?=E8=A7=88=E5=9C=B0=E5=9B=BE=E8=A7=86=E8=A7=92=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eagle/core/function/view/OverMapView.kt | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) 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) {