[Opt]全览模式暴露清除轨迹并隐藏起终点的接口

This commit is contained in:
chenfufeng
2023-02-15 19:41:49 +08:00
parent fa6907b05e
commit 6e7f810ece

View File

@@ -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
}
}
}