Merge branch 'dev_robo_240612_6.5.0_tmp' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robo_240612_6.5.0_tmp

This commit is contained in:
aibingbing
2024-07-01 19:37:34 +08:00
43 changed files with 743 additions and 193 deletions

View File

@@ -21,7 +21,12 @@ enum class Level(val zIndex: Int) {
GUIDE_ROUTE_LINE(75000),
/**
* 道路围栏区域绘制
* 围栏区域绘制
*/
MAP_POLYGON(76000)
MAP_POLYGON(76000),
/**
* 围栏区域底色
*/
MAP_POLYGON_SOLID(75500)
}

View File

@@ -56,6 +56,8 @@ data class Polyline(val id: String, val owner: String, val level: Level, val opt
val isShowArrow: Boolean = builder.isShowArrow
val isFilledIn: Boolean = builder.isFilledIn
fun builder(): Builder {
return builder
}
@@ -100,6 +102,8 @@ data class Polyline(val id: String, val owner: String, val level: Level, val opt
internal var isShowArrow: Boolean = false
internal var isFilledIn: Boolean = false
fun setId(id: String) = apply {
this.id = id
}
@@ -176,6 +180,10 @@ data class Polyline(val id: String, val owner: String, val level: Level, val opt
this.isShowArrow = show
}
fun isFilledIn(filled: Boolean) = apply {
this.isFilledIn = filled
}
fun build(): Options {
if (TextUtils.isEmpty(id)) {
id = UUID.randomUUID().toString()

View File

@@ -75,12 +75,17 @@ class AMapWrapper(map: MapAutoViewHelper?, mapView: MapAutoView, controller: IMo
e(TAG, "polyline参数为空")
return null
}
val delegate =
(if (polylineOptions.lineWidth > 0) mAMap!!.drawThickLine(polylineOptions) else mAMap!!.drawLine(
polylineOptions
))
?: return null
return AMapPolylineWrapper(options.id, delegate, mMapView)
if (options.isFilledIn) {
val delegate = mAMap?.drawPolygon(polylineOptions)
return AMapPolylineWrapper(options.id, delegate, mMapView)
} else {
val delegate =
(if (polylineOptions.lineWidth > 0) mAMap?.drawThickLine(polylineOptions) else mAMap?.drawLine(
polylineOptions
))
?: return null
return AMapPolylineWrapper(options.id, delegate, mMapView)
}
}
private val batchMarkerOptions = BatchMarkerOptions()

View File

@@ -7,7 +7,7 @@ import com.zhidaoauto.map.sdk.open.view.MapAutoView
import java.util.concurrent.atomic.*
import com.zhidaoauto.map.sdk.open.renders.poyline.Polyline
class AMapPolylineWrapper(private val id: String, private val delegate: Polyline, private val mMapAutoView: MapAutoView): IMapPolylineOverlay {
class AMapPolylineWrapper(private val id: String, private val delegate: Polyline?, private val mMapAutoView: MapAutoView): IMapPolylineOverlay {
private val isDestroyed by lazy { AtomicBoolean(false) }
@@ -19,7 +19,7 @@ class AMapPolylineWrapper(private val id: String, private val delegate: Polyline
override fun destroy() {
if (isDestroyed.compareAndSet(false, true)) {
try {
delegate.destroy()
delegate?.destroy()
} finally {
onRemoveAction?.invoke(id)
}
@@ -29,7 +29,7 @@ class AMapPolylineWrapper(private val id: String, private val delegate: Polyline
override fun remove() {
if (isRemoved.compareAndSet(false, true)) {
try {
delegate.remove()
delegate?.remove()
} finally {
onRemoveAction?.invoke(id)
}
@@ -40,7 +40,7 @@ class AMapPolylineWrapper(private val id: String, private val delegate: Polyline
if (isDestroyed.get() || isRemoved.get()) {
return
}
delegate.setVisible(visible)
delegate?.setVisible(visible)
}
override fun isDestroyed(): Boolean {
@@ -48,7 +48,7 @@ class AMapPolylineWrapper(private val id: String, private val delegate: Polyline
}
override fun isVisible(): Boolean {
return delegate.isVisible()
return delegate?.isVisible() ?: false
}
override fun setToTop() {
@@ -66,7 +66,7 @@ class AMapPolylineWrapper(private val id: String, private val delegate: Polyline
delegate.also {
val option = ObjectUtils.fromMogo(options,mMapAutoView)
if (option != null) {
it.setOption(option)
it?.setOption(option)
}
}
}