From 4f88d65a63ba4b7cc97a703bbec446fab344b4c5 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Mon, 9 Oct 2023 11:57:25 +0800 Subject: [PATCH] =?UTF-8?q?[6.1.0][Fix]=E8=A7=A3=E5=86=B3=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=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/eagle/core/function/view/OverMapView.kt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 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 ee41d68558..0dfd54bc27 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 @@ -152,6 +152,8 @@ class OverMapView @JvmOverloads constructor( @Volatile private var allPoints: List? = null + // 暂存下已选择的站点,确定可见视角的包含范围 + private var sitePointsTmp: List? = null companion object { private const val TAG = "OverMapView" @@ -876,8 +878,15 @@ class OverMapView @JvmOverloads constructor( //圈定地图显示范围 //存放经纬度 val boundsBuilder = LatLngBounds.Builder() - for (i in linePointsLatLng.indices) { - boundsBuilder.include(linePointsLatLng[i]) + val sitePoints = sitePointsTmp + if (!sitePoints.isNullOrEmpty()) { + for (i in sitePoints.indices) { + boundsBuilder.include(sitePoints[i]) + } + } else { + for (i in linePointsLatLng.indices) { + boundsBuilder.include(linePointsLatLng[i]) + } } val currentLatLng = LatLng(mLocation!!.latitude, mLocation!!.longitude) boundsBuilder.include(currentLatLng) @@ -977,6 +986,7 @@ class OverMapView @JvmOverloads constructor( for (i in coordinates.indices) { boundsBuilder.include(coordinates[i]) } + sitePointsTmp = coordinates isOnlyCarLocation = false } else { if (linePointsLatLng != null && linePointsLatLng.size > 1) { @@ -1085,6 +1095,7 @@ class OverMapView @JvmOverloads constructor( } siteMarkerList = null } + sitePointsTmp = null } private fun getBitmap(count: Int): Bitmap {