From 6e7f810ece07dd7434a633b62e2477046197d9dd Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Wed, 15 Feb 2023 19:41:49 +0800 Subject: [PATCH] =?UTF-8?q?[Opt]=E5=85=A8=E8=A7=88=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E6=9A=B4=E9=9C=B2=E6=B8=85=E9=99=A4=E8=BD=A8=E8=BF=B9=E5=B9=B6?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E8=B5=B7=E7=BB=88=E7=82=B9=E7=9A=84=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eagle/core/function/view/OverMapView.kt | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 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 8891300245..880661cafd 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 @@ -196,6 +196,20 @@ class OverMapView @JvmOverloads constructor( } } + /** + * 清空线路并隐藏起、终点 + */ + fun clearCustomPolyline() { + if (mBottomPolyline != null) { + mBottomPolyline!!.remove() + } + if (mCoveredPolyline != null) { + mCoveredPolyline!!.remove() + } + mStartMarker?.isVisible = false + mEndMarker?.isVisible = false + } + private fun initView(context: Context) { mContext = context val smpView = LayoutInflater.from(context).inflate(R.layout.module_overview_map_view, this) @@ -413,15 +427,6 @@ class OverMapView @JvmOverloads constructor( return false } - fun clearCustomPolyline() { - if (mBottomPolyline != null) { - mBottomPolyline!!.remove() - } - if (mCoveredPolyline != null) { - mCoveredPolyline!!.remove() - } - } - /** * 绘制新基建Markers(比如:摄像头) * @@ -615,6 +620,7 @@ class OverMapView @JvmOverloads constructor( mCoveredPolyline = mAMap!!.addPolyline(polylineOptions) if (mBottomPolyline != null) { mBottomPolyline!!.remove() + mBottomPolyline = null } } }