fixed bug
This commit is contained in:
@@ -4,16 +4,16 @@ import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.Message
|
||||
import android.text.TextUtils
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.map.marker.IMogoMarker
|
||||
import com.mogo.map.marker.MogoMarkerOptions
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.common.constants.DataTypes
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler
|
||||
import com.mogo.map.MogoMarkerManager
|
||||
import com.mogo.map.marker.IMogoMarker
|
||||
import com.mogo.map.marker.MogoMarkerOptions
|
||||
import com.mogo.module.common.constants.DataTypes
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
@@ -98,18 +98,20 @@ object TrafficMarkerDrawer {
|
||||
* 更新识别数据颜色
|
||||
*/
|
||||
fun updateITrafficThreatLevelInfo(trafficData: TrafficData) {
|
||||
val tempTraffic = mTrafficMap[trafficData.uuid]
|
||||
if (tempTraffic != null) {
|
||||
tempTraffic.lat = trafficData.lat
|
||||
tempTraffic.lon = trafficData.lon
|
||||
tempTraffic.heading = trafficData.heading
|
||||
tempTraffic.threatLevel = trafficData.threatLevel
|
||||
if (trafficData.uuid != null) {
|
||||
mTrafficMap[trafficData.uuid!!] = tempTraffic
|
||||
}
|
||||
} else {
|
||||
if (trafficData.uuid != null) {
|
||||
mTrafficMap[trafficData.uuid!!] = trafficData
|
||||
if (trafficData != null && !TextUtils.isEmpty(trafficData.uuid)) {
|
||||
val tempTraffic = mTrafficMap[trafficData.uuid]
|
||||
if (tempTraffic != null) {
|
||||
tempTraffic.lat = trafficData.lat
|
||||
tempTraffic.lon = trafficData.lon
|
||||
tempTraffic.heading = trafficData.heading
|
||||
tempTraffic.threatLevel = trafficData.threatLevel
|
||||
if (trafficData.uuid != null) {
|
||||
mTrafficMap[trafficData.uuid!!] = tempTraffic
|
||||
}
|
||||
} else {
|
||||
if (trafficData.uuid != null) {
|
||||
mTrafficMap[trafficData.uuid!!] = trafficData
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -157,8 +159,8 @@ object TrafficMarkerDrawer {
|
||||
*/
|
||||
private fun drawObuRecognizedDataMarker(trafficData: TrafficData) {
|
||||
CallerLogger.d(
|
||||
TAG,
|
||||
"trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel
|
||||
TAG,
|
||||
"trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel
|
||||
)
|
||||
if (trafficData.type != null) {
|
||||
val resId: Int = trafficData.type.traffic3DIconId
|
||||
@@ -175,10 +177,10 @@ object TrafficMarkerDrawer {
|
||||
.icon3DRes(resId)
|
||||
.rotate(trafficData.heading.toFloat())
|
||||
.position(
|
||||
com.mogo.eagle.core.data.map.MogoLatLng(
|
||||
trafficData.lat,
|
||||
trafficData.lon
|
||||
)
|
||||
com.mogo.eagle.core.data.map.MogoLatLng(
|
||||
trafficData.lat,
|
||||
trafficData.lon
|
||||
)
|
||||
)
|
||||
|
||||
if (trafficData.type != TrafficTypeEnum.TYPE_TRAFFIC_ID_SPECIAL_VEHICLE) {
|
||||
@@ -213,12 +215,12 @@ object TrafficMarkerDrawer {
|
||||
* 带动画的修改Marker
|
||||
*/
|
||||
private fun changeDynamicMarker(
|
||||
marker: IMogoMarker,
|
||||
trafficData: TrafficData
|
||||
marker: IMogoMarker,
|
||||
trafficData: TrafficData
|
||||
) {
|
||||
CallerLogger.d(
|
||||
TAG,
|
||||
"trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel
|
||||
TAG,
|
||||
"trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel
|
||||
)
|
||||
if (trafficData.type != TrafficTypeEnum.TYPE_TRAFFIC_ID_SPECIAL_VEHICLE) {
|
||||
// 修改颜色
|
||||
@@ -240,14 +242,14 @@ object TrafficMarkerDrawer {
|
||||
|
||||
try {
|
||||
marker.addDynamicAnchorPosition(
|
||||
com.mogo.eagle.core.data.map.MogoLatLng(
|
||||
trafficData.lat,
|
||||
trafficData.lon
|
||||
),
|
||||
trafficData.heading.toFloat(),
|
||||
stepTime
|
||||
com.mogo.eagle.core.data.map.MogoLatLng(
|
||||
trafficData.lat,
|
||||
trafficData.lon
|
||||
),
|
||||
trafficData.heading.toFloat(),
|
||||
stepTime
|
||||
)
|
||||
} catch (e:Exception) {
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
try {
|
||||
drawObuRecognizedDataMarker(trafficData)
|
||||
|
||||
Reference in New Issue
Block a user