Merge branch 'dev_robo_240612_6.5.0_tmp' into dev_robotaxi-d_240705_6.5.0

This commit is contained in:
EmArrow
2024-07-05 20:01:17 +08:00
13 changed files with 228 additions and 72 deletions

View File

@@ -11,6 +11,7 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.enums.CommunicationType
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
import com.mogo.eagle.core.data.enums.WarningDirectionEnum.ALERT_WARNING_TOP
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay
import com.mogo.eagle.core.data.map.entity.MarkerLocation
@@ -31,6 +32,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerV2XListenerManager.V2NC
import com.mogo.eagle.core.function.call.autopilot.CallerV2nNioEventListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.hmi.CallerRoadV2NEventWindowListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager.saveMsgBox
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
@@ -42,6 +44,8 @@ import com.mogo.eagle.core.utilcode.util.CoordinateUtils
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.function.biz.v2x.V2XBizTrace
import com.mogo.eagle.function.biz.v2x.v2n.consts.V2XConst
import com.mogo.eagle.function.biz.v2x.v2n.remove.MarkerWrapper
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.AiRoadMarker
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.AiRoadMarker.Marker
import com.mogo.eagle.function.biz.v2x.v2n.utils.EventDismissBean
@@ -51,6 +55,8 @@ import com.mogo.eagle.function.biz.v2x.v2n.utils.V2NUtils
import com.mogo.eagle.function.biz.v2x.v2n.utils.V2XEventAnalyticsManager
import com.mogo.map.MapDataWrapper
import com.mogo.map.entities.Lane
import com.mogo.map.overlay.core.Level.MAP_MARKER
import com.mogo.map.overlay.point.Point
import mogo.telematics.pad.MessagePad
import mogo.telematics.pad.MessagePad.Header
import mogo.telematics.pad.MessagePad.TrackedObject
@@ -58,6 +64,7 @@ import mogo.telematics.pad.MessagePad.V2nCrossSpeed
import mogo.v2x.MogoV2X
import mogo.v2x.MogoV2X.RSI_PB
import mogo.v2x.MogoV2X.RTEData_PB
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.TimeUnit.SECONDS
import kotlin.math.abs
@@ -73,6 +80,13 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
private const val MSG_WHAT_DRAW_YONGDU = 0x1012 // 交通拥堵
private const val MSG_WHAT_DRAW_OTHER_RETROGRADE_VEHICLE = 0x1013 // 他车倒车/逆行
private const val MSG_WHAT_DRAW_GREEN_WAVE = 0x1014 // 绿波通行
private const val MSG_WHAT_DRAW_PEOPLE_CROSS = 0x1015 // 行人横穿
private val builder_people_cross by lazy {
Point.Options.Builder(V2XConst.V2X_MARKER_OWNER, MAP_MARKER).isUseGps(true).anchorColor("#D65D5AFF").set3DMode(true).icon3DRes(TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE.traffic3DIconId)
}
private val markers by lazy { ConcurrentHashMap<String, MarkerWrapper>() }
private val callback = Handler.Callback { msg ->
if (msg.what == MSG_WHAT_DRAW_SHIGONE || msg.what == MSG_WHAT_DRAW_SHIGU) {
@@ -385,6 +399,35 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
}
}
}
} else if (msg.what == MSG_WHAT_DRAW_PEOPLE_CROSS) {
val data = msg.obj as? MessagePad.Event ?: return@Callback true
AiRoadMarker.aiMakers.getOrPut(data.eventId) {
AiRoadMarker()
}.apply {
val isDriver = AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
val carLocation = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
val distance = CoordinateUtils.calculateLineDistance(carLocation.longitude, carLocation.latitude, data.longitude, data.latitude)
if (distance > 150) {
Logger.i(TAG, "people cross --> distance > 150")
V2XBizTrace.onAck(TAG, mapOf("people cross" to "distance > 150"), true)
return@Callback true
}
val cameraIp = if(TextUtils.isEmpty(data.exts)) ""
else (GsonUtils.fromJson(data.exts, Map::class.java)["cameraIp"])?:""
// 弹事件框
CallerRoadV2NEventWindowListenerManager.showLiveVideo(
data.eventId,
data.timestamp,
EventTypeEnumNew.getUpdateIconRes(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType),
String.format(EventTypeEnumNew.getAlarmContent(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType), distance.toInt()),
isDriver,
cameraIp.toString(),
data.longitude,
data.latitude)
}.also {
it.marker(Marker(data.eventId, EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType, data.longitude, data.latitude, 0.0), drawMarker = true, false, isHighFrequency = true)
}.receive()
}
true
}
@@ -573,6 +616,14 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
}
}
private fun drawPeopleCross(event: MessagePad.Event) {
Log.d("V2NIdentifyDrawer", "---drawPeopleCross---: $event, [${FunctionBuildConfig.v2nMainSwitch}, ${FunctionBuildConfig.isNewV2NData}]")
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
handler.removeMessages(MSG_WHAT_DRAW_PEOPLE_CROSS)
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_PEOPLE_CROSS, event))
}
}
private val nioEventListener = object : IMoGoV2nNioEventListener {
override fun onV2nNioCongestionEvent(congestion: MessagePad.V2nCongestion) {
super.onV2nNioCongestionEvent(congestion)
@@ -582,7 +633,7 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
override fun onV2nNioCrossoverEvent(event: MessagePad.Event) {
super.onV2nNioCrossoverEvent(event)
V2XBizTrace.onAck(event,"onV2nNioCrossoverEvent", true)
//TODO renwj
drawPeopleCross(event)
}
override fun onV2nNioGreenWavePassageEvent(crossSpeed: V2nCrossSpeed) {

View File

@@ -19,7 +19,7 @@ import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.atomic.AtomicReference
data class MarkerWrapper(val id: String, val lon: Double, val lat: Double, val coordinateType: Int, var markers: ArrayList<Point>? = null, var lines: ArrayList<Polyline>? = null, var elapsedDistance: Int = 500, var elapsedDuration: Long = -1, var onRemoved:((id: String) -> Unit)? = null) {
data class MarkerWrapper(val id: String, var lon: Double, var lat: Double, val coordinateType: Int, var markers: ArrayList<Point>? = null, var lines: ArrayList<Polyline>? = null, var elapsedDistance: Int = 500, var elapsedDuration: Long = -1, var onRemoved:((id: String) -> Unit)? = null) {
fun addLine(line: Polyline) {
var ll = this.lines
@@ -215,4 +215,8 @@ object MarkerRemoveManager {
handler.postDelayed(checkTask, 1000)
}
}
fun peekMarker(id: String): MarkerWrapper? {
return showedMarkers.find { it.id == id }
}
}

View File

@@ -21,11 +21,15 @@ import com.mogo.eagle.function.biz.v2x.v2n.remove.MarkerRemoveManager
import com.mogo.eagle.function.biz.v2x.v2n.remove.MarkerWrapper
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.road.V2XAiRoadEventMarker
import com.mogo.map.MogoData.Companion.mogoMapData
import com.mogo.map.overlay.core.Level
import com.mogo.map.overlay.core.Level.MAP_MARKER
import com.mogo.map.overlay.core.Level.ROAD_CENTER_LINE
import com.mogo.map.overlay.line.Polyline
import com.mogo.map.overlay.point.Point
import com.zhidaoauto.map.data.road.CenterLine
import java.util.*
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.CopyOnWriteArraySet
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.atomic.AtomicReference
@@ -42,10 +46,19 @@ class AiRoadMarker {
private const val TAG = "AiRoadMarker"
private val COLOR_START = Color.parseColor("#002ABAD9")
private val COLOR_END = Color.parseColor("#66FF7A30")
private val builders by lazy { ConcurrentHashMap<String, Point.Options.Builder>() }
private val markerIds by lazy { CopyOnWriteArraySet<String>() }
internal fun getOrPutPointOptionBuilder(id: String, owner: String, level: Level): Point.Options.Builder {
return builders.getOrPut(id) { Point.Options.Builder(owner, level) }
}
}
private val marker by lazy { AtomicReference<Marker>() }
private val overlayManager by lazy {
CallerMapUIServiceManager.getOverlayManager()
}
@@ -84,68 +97,98 @@ class AiRoadMarker {
.setWidth(50f).setUseGps(true)
}
fun marker(marker: Marker, drawMarker: Boolean, drawRoadLine: Boolean = false) {
v2nDrawHandler.post {
val location = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
this.marker.set(marker)
var elapsedDistance = 500
if (marker.poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType) {
elapsedDistance = 10
}
var elapsedDuration = -1L
if (marker.poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType) {
elapsedDuration = TimeUnit.SECONDS.toMillis(3)
}
val wrapper = MarkerWrapper(marker.id, marker.poi_lon, marker.poi_lat, 1, elapsedDistance = elapsedDistance, elapsedDuration = elapsedDuration)
if (drawMarker) {
marker.entity?.apply { roadMarker.drawMarkers(this, wrapper) }
}
if (drawRoadLine) {
//施工中心点前方的自车行驶方向上300米距离
var l1: CenterLine? = null
var l2: CenterLine? = null
mogoMapData.get()?.getCenterLineRangeInfo(
marker.poi_lon,
marker.poi_lat,
location.heading.toFloat(),
300f, call = { result ->
//施工中心点后方的自车行驶方向上300米距离
result?.let {
V2XBizTrace.onAck("$TAG -marker-3-l1:", it)
l1 = result
}
countDown.incrementAndGet()
realMark(marker, wrapper, l1, l2, location.heading)
})
mogoMapData.get()?.getCenterLineRangeInfo(
marker.poi_lon,
marker.poi_lat,
location.heading.toFloat(),
-200f, call = { result ->
result?.let {
V2XBizTrace.onAck("$TAG -marker-3-l2:", it)
l2 = result
}
countDown.incrementAndGet()
realMark(marker, wrapper, l1, l2, location.heading)
})
fun marker(marker: Marker, drawMarker: Boolean, drawRoadLine: Boolean = false, isHighFrequency:Boolean = false) {
val markerId = marker.id
if (isHighFrequency && drawMarker) {
val builder = getOrPutPointOptionBuilder(markerId, V2XConst.V2X_MARKER_OWNER, MAP_MARKER)
builder
.set3DMode(true)
.isUseGps(true)
.icon3DRes(EventTypeEnumNew.getMarker3DRes(marker.poiType))
.anchorColor("#D65D5AFF")
.longitude(marker.poi_lon)
.latitude(marker.poi_lat)
CallerMapUIServiceManager.getOverlayManager()?.showOrUpdatePoint(builder.build())?.let { p ->
if (!markerIds.contains(markerId)) {
markerIds.add(markerId)
val wrapper = MarkerWrapper(markerId, marker.poi_lon, marker.poi_lat, 1, elapsedDistance = 10)
wrapper.onRemoved = {
builders.remove(markerId)
markerIds.remove(p.id)
}
wrapper.addPoint(p)
MarkerRemoveManager.addMarker(wrapper)
} else {
MarkerRemoveManager.peekMarker(markerId)?.also {
it.lon = marker.poi_lon
it.lat = marker.poi_lat
}
}
}
} else {
v2nDrawHandler.post {
val location = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
this.marker.set(marker)
var elapsedDistance = 500
if (marker.poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType) {
elapsedDistance = 10
}
var elapsedDuration = -1L
if (marker.poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType) {
elapsedDuration = TimeUnit.SECONDS.toMillis(3)
}
val wrapper = MarkerWrapper(markerId, marker.poi_lon, marker.poi_lat, 1, elapsedDistance = elapsedDistance, elapsedDuration = elapsedDuration)
if (drawMarker) {
marker.entity?.apply { roadMarker.drawMarkers(this, wrapper) }
}
if (drawRoadLine) {
//施工中心点前方的自车行驶方向上300米距离
var l1: CenterLine? = null
var l2: CenterLine? = null
mogoMapData.get()?.getCenterLineRangeInfo(
marker.poi_lon,
marker.poi_lat,
location.heading.toFloat(),
300f, call = { result ->
//施工中心点后方的自车行驶方向上300米距离
result?.let {
V2XBizTrace.onAck("$TAG -marker-3-l1:", it)
l1 = result
}
countDown.incrementAndGet()
realMark(marker, wrapper, l1, l2, location.heading)
})
mogoMapData.get()?.getCenterLineRangeInfo(
marker.poi_lon,
marker.poi_lat,
location.heading.toFloat(),
-200f, call = { result ->
result?.let {
V2XBizTrace.onAck("$TAG -marker-3-l2:", it)
l2 = result
}
countDown.incrementAndGet()
realMark(marker, wrapper, l1, l2, location.heading)
})
}
if (marker.poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType) {
val builder = Polyline.Options.Builder(V2XConst.V2X_MARKER_OWNER, ROAD_CENTER_LINE)
builder.colors(listOf(Color.parseColor("#996DFED0"), Color.parseColor("#CC6DFED0"), Color.parseColor("#C76DFED0"), Color.parseColor("#006DFED0")))
.setWidth(5f)
.setUseGps(true)
.points(listOf(MogoLatLng(location.latitude, location.longitude), MogoLatLng(marker.poi_lat, marker.poi_lon)))
.setIsGradient(true)
.isShowArrow(true)
CallerMapUIServiceManager.getOverlayManager()?.showOrUpdateLine(builder.build())?.also { wrapper.addLine(it) }
if (marker.poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType) {
val builder = Polyline.Options.Builder(V2XConst.V2X_MARKER_OWNER, ROAD_CENTER_LINE)
builder.colors(listOf(Color.parseColor("#996DFED0"), Color.parseColor("#CC6DFED0"), Color.parseColor("#C76DFED0"), Color.parseColor("#006DFED0")))
.setWidth(50f)
.setUseGps(true)
.points(listOf(MogoLatLng(location.latitude, location.longitude), MogoLatLng(marker.poi_lat, marker.poi_lon)))
.setIsGradient(true)
.isShowArrow(true)
CallerMapUIServiceManager.getOverlayManager()?.showOrUpdateLine(builder.build())?.also { wrapper.addLine(it) }
}
wrapper.onRemoved = { id ->
aiMakers.remove(id)
}
MarkerRemoveManager.addMarker(wrapper)
}
wrapper.onRemoved = { id ->
aiMakers.remove(id)
}
MarkerRemoveManager.addMarker(wrapper)
}
}
@Synchronized

View File

@@ -49,7 +49,7 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
MarkerLocation location = noveltyInfo.getLocation();
AiRoadMarker.Marker m = new AiRoadMarker.Marker(noveltyInfo.getInfoId(), noveltyInfo.getPoiType(), gpsLocation.second, gpsLocation.first, location.getAngle(), polygons, null, entity);
AiRoadMarker aiMarker = new AiRoadMarker();
aiMarker.marker(m, true, isDrawRoadLine(m.getPoiType()));
aiMarker.marker(m, true, isDrawRoadLine(m.getPoiType()), false);
AiRoadMarker.aiMakers.put(noveltyInfo.getInfoId(), aiMarker);
}
} else {

View File

@@ -419,7 +419,17 @@ class MoGoHmiProvider : IMoGoHmiProvider {
.width(WindowManager.LayoutParams.WRAP_CONTENT)
.height(WindowManager.LayoutParams.WRAP_CONTENT)
.attachToActivity(activity)
.draggable(true)
.gravityInActivity(Gravity.CENTER)
.also {
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
it.offsetX(960)
it.offsetY(445)
} else {
it.offsetX(980)
it.offsetY(-324)
}
}
.onDismissed {
greenWave.set(null)
}

View File

@@ -10,6 +10,8 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isPassenger
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isTaxi
import com.mogo.map.overlay.core.Level
import com.mogo.map.overlay.point.Point
import com.zhidaoauto.map.sdk.open.renders.marker.Marker
import com.zhidaoauto.map.sdk.open.renders.marker.MarkerOptions
import mogo.telematics.pad.MessagePad.*
object TrackerSourceFilterHelper {
@@ -112,7 +114,7 @@ object TrackerSourceFilterHelper {
.setDisplayAnim(true)
.setAnimScale(getAnimScale(data.type))
.build()
CallerMapUIServiceManager.getOverlayManager()?.showOrUpdatePoint(opt)
CallerMapUIServiceManager.getOverlayManager()?.updateAnimPoint(opt)
//消息埋点
CallerFuncBizListenerManager.invokeAttrZombieAnalyticsEvent()
}

View File

@@ -526,6 +526,13 @@ enum class EventTypeEnumNew(
content = "保持当前车速即可通过路口,好丝滑!",
tts = "保持当前车速即可通过路口,好丝滑!"
),
TYPE_SOCKET_ROAD_PEOPLE_CROSS(
"100064",
"行人横穿",
poiTypeSrcVr = View.NO_ID,
content = "前方%s米有行人/非机动车横穿,蘑菇提醒您提前减速,注意观察,小心通过",
tts = "前方%s米有行人/非机动车横穿,蘑菇提醒您提前减速,注意观察,小心通过"
),
TYPE_ERROR(
0.toString(),
"未知/错误/异常",
@@ -822,6 +829,7 @@ enum class EventTypeEnumNew(
}
}
TYPE_SOCKET_ROAD_CONGESTION.poiType -> R.raw.v2x_yongdu
TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType -> if (FunctionBuildConfig.skinMode != 0) TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE.traffic3DIconId else TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE.traffic3DNightIconId
else -> 0
}
}
@@ -1194,6 +1202,8 @@ enum class EventTypeEnumNew(
TYPE_SOCKET_ROAD_CONGESTION.poiType -> R.drawable.v2x_icon_yongdu_vr
// 他车逆行/倒车
TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType -> if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) R.drawable.icon_v2x_other_retrograde_vehicle_passenger else R.drawable.icon_v2x_other_retrograde_vehicle_driver
// 行人/非机动车横穿
TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType -> if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) R.drawable.icon_xingren_hengchuan_passenger else R.drawable.icon_xingren_hengchuan_driver
// 通过公交站
TYPE_USECASE_ROAD_BUS_STATION.poiType -> if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) R.drawable.icon_v2x_bus_station_passenger else R.drawable.icon_v2x_bus_station_driver
//拥堵

View File

@@ -15,11 +15,14 @@ import android.widget.PopupWindow
import androidx.annotation.LayoutRes
import androidx.core.view.doOnAttach
import com.mogo.eagle.core.utilcode.kotlin.lifeCycleScope
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import java.util.concurrent.atomic.AtomicBoolean
class MoGoPopWindow private constructor(builder: Builder){
companion object {
private const val TAG = "MoGoPopWindow"
}
private val content: View = builder.content ?: throw AssertionError("要填充的View不能为空")
@@ -109,9 +112,19 @@ class MoGoPopWindow private constructor(builder: Builder){
val params = content.rootView.layoutParams as WindowManager.LayoutParams
val oldX = params.x
val oldY = params.y
val newX = oldX + dx
val newY = oldY + dy
Logger.d(TAG, "oldX: $oldX, oldY: $oldY, dx: $dx, dy:$dy")
var newX = oldX + dx
var newY = oldY + dy
if (outer.contains(rawX.toInt(), rawY.toInt())) {
val width = activity.resources.displayMetrics.widthPixels
val height = activity.resources.displayMetrics.heightPixels
// if (newX < 0) {
// newX += newX
// }
// if (newY < 0) {
// newY += height
// }
Logger.d(TAG, "screen_width: $width, screen_height: $height, newX: $newX, newY: $newY, rawX: ${rawX.toInt()}, rawY: ${rawY.toInt()}, width: ${content.width}, height: ${content.height}")
pop.update(newX, newY, content.width, content.height)
}
oldRawX = rawX
@@ -252,7 +265,7 @@ class MoGoPopWindow private constructor(builder: Builder){
}
fun offsetX(x: Int) = apply {
this.offsetY = x
this.offsetX = x
}
fun offsetY(y: Int) = apply {

View File

@@ -33,6 +33,8 @@ interface IMogoMap {
fun addPoint(options: Point.Options): IMapPointOverlay?
fun addAnimPoint(options: Point.Options)
fun addLine(options: Polyline.Options): IMapPolylineOverlay?
/**

View File

@@ -75,4 +75,6 @@ interface IMoGoOverlayManager {
fun hideAllPointsExceptIds(vararg ids: String)
fun hideAllPointsExceptOwners(vararg owners: String)
fun updateAnimPoint(options: Point.Options, mapTag:String = DEFAULT)
}

View File

@@ -11,8 +11,10 @@ import com.mogo.map.overlay.wrapper.line.AMapPolylineWrapper
import com.mogo.map.overlay.wrapper.point.AMapPointWrapper
import com.mogo.map.uicontroller.IMogoMapUIController
import com.mogo.map.utils.ObjectUtils
import com.zhidaoauto.map.data.point.LonLatPoint
import com.zhidaoauto.map.sdk.open.renders.marker.BatchMarkerOptions
import com.zhidaoauto.map.sdk.open.renders.marker.Marker
import com.zhidaoauto.map.sdk.open.renders.marker.MarkerOptions
import com.zhidaoauto.map.sdk.open.renders.marker.MarkerSimpleData
import com.zhidaoauto.map.sdk.open.renders.marker.OnMarkClickListener
import com.zhidaoauto.map.sdk.open.view.MapAutoView
@@ -66,6 +68,20 @@ class AMapWrapper(map: MapAutoViewHelper?, mapView: MapAutoView, controller: IMo
return AMapPointWrapper(options.id, delegate, mMapView)
}
override fun addAnimPoint(options: Point.Options) {
if (!checkAMap()) {
return
}
val markerOptions = MarkerOptions(options.id, mMapView.getMapController()).setGps(true)
.position(LonLatPoint(options.longitude, options.latitude, options.rotate.toDouble()))
val marker = Marker(markerOptions,mMapView.getMapController(),
mMapView.getMapController()?.getMarkerCall()
)
marker.setDisplayAnimEnable(true)
marker.setAnimResource(options.animRes)
marker.setAnimScale(options.animScale)
}
override fun addLine(options: Polyline.Options): IMapPolylineOverlay? {
if (!checkAMap()) {
return null

View File

@@ -5,6 +5,7 @@ import android.view.View
import com.mogo.eagle.core.data.map.*
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.map.MogoMap
import com.mogo.map.overlay.point.Point.Options
import com.mogo.map.MogoMap.Companion.mapInstance
import com.mogo.map.overlay.core.*
@@ -49,13 +50,15 @@ internal class MoGoOverlayManagerImpl: IMoGoOverlayManager {
key.delegate = point
it.setToTop()
if (options.moveToCenter) {
val wgs84 = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
val cj02 = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
moveToCenter(
mapTag,
options.id,
options.longitude,
options.latitude,
if (options.isGps) CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude else CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().longitude,
if (options.isGps) CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude else CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().latitude
if (options.isGps) wgs84.longitude else cj02.longitude,
if (options.isGps) wgs84.latitude else cj02.latitude
)
}
}
@@ -452,4 +455,8 @@ internal class MoGoOverlayManagerImpl: IMoGoOverlayManager {
it.value.setVisible(false)
}
}
override fun updateAnimPoint(options: Options, mapTag:String) {
mapInstance.getMogoMap(mapTag)?.addAnimPoint(options)
}
}

View File

@@ -3,7 +3,6 @@ package com.mogo.map.utils;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
@@ -65,9 +64,6 @@ public class ObjectUtils {
.controlAngle(opt.isControlAngle())
.rotateAngle(opt.getRotate())
.setFlat(opt.isFlat())
// .setAnimResource()
// .setDisplayAnimEnable()
// .setAnimScale()
.visible(opt.isVisible())
.infoWindowEnable(opt.isInfoWindowEnable())
.scale(opt.getScale())