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 {