From 15f0d4d27d8adf1105dfb0bb43dff39cf29a8c9f Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Wed, 1 Mar 2023 19:39:14 +0800 Subject: [PATCH] =?UTF-8?q?[Opt3.0]=E5=85=A8=E8=A7=88=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=B8=8D=E7=BB=98=E5=88=B6=E8=B5=B7=E3=80=81?= =?UTF-8?q?=E7=BB=88=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eagle/core/function/view/OverMapView.kt | 19 ++++++++----------- 1 file changed, 8 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 0db745b464..f7d42bc526 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 @@ -355,7 +355,8 @@ class OverMapView @JvmOverloads constructor( if (startPointDrawable != -1) { mStartMarker = mAMap!!.addMarker( MarkerOptions() - .icon(BitmapDescriptorFactory.fromResource(startPointDrawable))) + .icon(BitmapDescriptorFactory.fromResource(startPointDrawable)) + ) } if (endPointDrawable != -1) { mEndMarker = mAMap!!.addMarker( @@ -608,20 +609,16 @@ class OverMapView @JvmOverloads constructor( * 绘制起始点、终点 */ private fun drawStartAndEndMarker(coordinates: List) { - if (mStartMarker != null) { - mStartMarker!!.isVisible = false - } - if (mEndMarker != null) { - mEndMarker!!.isVisible = false - } + mStartMarker?.isVisible = false + mEndMarker?.isVisible = false if (coordinates.size > 2) { // 设置开始结束Marker位置 val startLatLng = coordinates[0] val endLatLng = coordinates[coordinates.size - 1] - mStartMarker!!.position = startLatLng - mEndMarker!!.position = endLatLng - mStartMarker!!.isVisible = true - mEndMarker!!.isVisible = true + mStartMarker?.position = startLatLng + mEndMarker?.position = endLatLng + mStartMarker?.isVisible = true + mEndMarker?.isVisible = true } }