[2.13.2] add interface of wgs84 to gaode

This commit is contained in:
zhongchao
2022-12-22 18:32:47 +08:00
parent 1a6a22f764
commit 7eadb4e2ae
3 changed files with 43 additions and 26 deletions

View File

@@ -8,6 +8,7 @@ import com.mogo.eagle.core.data.map.entity.MarkerLocation
import com.mogo.eagle.core.data.map.entity.MarkerUserInfo
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker
import com.mogo.map.MogoMap
import com.mogo.v2x.data.*
import mogo.telematics.pad.MessagePad
import roadwork.Road
@@ -83,12 +84,9 @@ fun Road.RW_PB.toRoadMarker(): V2XMarkerCardResult =
l3.poiType = this.roadwork?.poiType?.toString()
l3.generateTime = this.roadwork?.detectTime ?: 0L
l3.location = V2XMarkerLocation().also { l4 ->
val p = CoordinateUtils.transformWgsToGcj(
this.roadwork?.center?.point?.lat ?: 0.0,
this.roadwork?.center?.point?.lon ?: 0.0
)
l4.lon = p[0]
l4.lat = p[1]
val p = MogoMap.getInstance().mogoMap.switchLonLat(this.roadwork?.center?.point?.lon ?: 0.0,this.roadwork?.center?.point?.lat ?: 0.0)
l4.lon = p.lon
l4.lat = p.lat
l4.angle = this.roadwork?.center?.road?.bearing?.toDouble() ?: 0.0
}
})
@@ -119,9 +117,9 @@ fun MessagePad.TrackedObject.toRoadMarker(poiType: String): V2XMarkerCardResult
l3.poiType = poiType
l3.generateTime = 0L
l3.location = V2XMarkerLocation().also { l4 ->
val p = CoordinateUtils.transformWgsToGcj(this.latitude, this.longitude)
l4.lon = p[0]
l4.lat = p[1]
val p = MogoMap.getInstance().mogoMap.switchLonLat(this.longitude,this.latitude)
l4.lon = p.lon
l4.lat = p.lat
l4.angle = this.heading
}
})