From f07fb8b84f79ddb8a60a90b1469feb065c4585e5 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Mon, 9 Oct 2023 15:28:12 +0800 Subject: [PATCH] =?UTF-8?q?[6.1.0][Opt]=E6=B7=BB=E5=8A=A0=E5=85=A8?= =?UTF-8?q?=E8=A7=88=E8=A7=86=E8=A7=92=E5=88=87=E6=8D=A2=E7=9A=84=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eagle/core/function/view/OverMapView.kt | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 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 0dfd54bc27..5c26b0e1a5 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 @@ -874,22 +874,31 @@ class OverMapView @JvmOverloads constructor( private fun realDisplayOverView() { Log.d(TAG, "realDisplayOverView被调用") val linePointsLatLng = allPoints - if (linePointsLatLng != null && linePointsLatLng.size > 1 && mLocation != null) { - //圈定地图显示范围 - //存放经纬度 - val boundsBuilder = LatLngBounds.Builder() - val sitePoints = sitePointsTmp - if (!sitePoints.isNullOrEmpty()) { - for (i in sitePoints.indices) { - boundsBuilder.include(sitePoints[i]) - } - } else { + var isOnlyCarLocation = true + //圈定地图显示范围 + //存放经纬度 + val boundsBuilder = LatLngBounds.Builder() + val sitePoints = sitePointsTmp + if (!sitePoints.isNullOrEmpty()) { + for (i in sitePoints.indices) { + boundsBuilder.include(sitePoints[i]) + } + isOnlyCarLocation = false + Log.d(TAG, "realDisplayOverView#地图视角包含站点") + } else { + if (linePointsLatLng != null && linePointsLatLng.size > 1) { for (i in linePointsLatLng.indices) { boundsBuilder.include(linePointsLatLng[i]) } + isOnlyCarLocation = false + Log.d(TAG, "realDisplayOverView#地图视角包含自驾轨迹") + } + } + if (!isOnlyCarLocation) { + if (mLocation != null) { + val currentLatLng = LatLng(mLocation!!.latitude, mLocation!!.longitude) + boundsBuilder.include(currentLatLng) } - val currentLatLng = LatLng(mLocation!!.latitude, mLocation!!.longitude) - boundsBuilder.include(currentLatLng) val cameraPosition = CameraPosition.Builder().tilt(mTilt).build() //第二个参数为四周留空宽度 if (mAMap != null) { @@ -903,7 +912,6 @@ class OverMapView @JvmOverloads constructor( ) ) mAMap!!.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)) - Log.d(TAG, "切换视角展示轨迹点和车!") } } else { if (mLocation != null && mAMap != null) { @@ -986,6 +994,7 @@ class OverMapView @JvmOverloads constructor( for (i in coordinates.indices) { boundsBuilder.include(coordinates[i]) } + Log.d(TAG, "realIncludeSitePointsAndRefresh#地图视角包含站点") sitePointsTmp = coordinates isOnlyCarLocation = false } else { @@ -994,6 +1003,7 @@ class OverMapView @JvmOverloads constructor( for (i in linePointsLatLng.indices) { boundsBuilder.include(linePointsLatLng[i]) } + Log.d(TAG, "realIncludeSitePointsAndRefresh#地图视角包含自驾轨迹") isOnlyCarLocation = false } } @@ -1096,6 +1106,7 @@ class OverMapView @JvmOverloads constructor( siteMarkerList = null } sitePointsTmp = null + Log.d(TAG, "realClearSiteMarkers") } private fun getBitmap(count: Int): Bitmap {