Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
p x
MapMultiEngine
Commits
d8a1e0d4
Commit
d8a1e0d4
authored
Dec 30, 2025
by
p x
Browse files
修改DEMO
parent
c0a4d214
Changes
31
Hide whitespace changes
Inline
Side-by-side
mapapi/src/main/java/com/cusc/map/location/On
Ms
GpsLoc.kt
→
mapapi/src/main/java/com/cusc/map/location/OnGpsLoc.kt
View file @
d8a1e0d4
package
com.cusc.map.location
package
com.cusc.map.location
/**业务层Gps定位回调接口**/
/**业务层Gps定位回调接口**/
interface
On
Ms
GpsLoc
{
interface
OnGpsLoc
{
fun
onMsGpsLoc
(
mSLocBean
:
MS
LocCb
)
fun
onMsGpsLoc
(
mSLocBean
:
LocCb
M
)
}
}
\ No newline at end of file
mapapi/src/main/java/com/cusc/map/maps/DrawInMap.kt
View file @
d8a1e0d4
...
@@ -26,7 +26,7 @@ class MsPolylineOptions {
...
@@ -26,7 +26,7 @@ class MsPolylineOptions {
/***绘制圆形选项**/
/***绘制圆形选项**/
class
Ms
CircleOptions
{
class
CircleOptions
M
{
/**半径(米)**/
/**半径(米)**/
var
radius
=
100f
var
radius
=
100f
...
@@ -116,7 +116,7 @@ object DrawInMap : MsOperationParent() {
...
@@ -116,7 +116,7 @@ object DrawInMap : MsOperationParent() {
*/
*/
fun
drawCircle
(
fun
drawCircle
(
center
:
LatLngM
,
center
:
LatLngM
,
msCircleOptions
:
Ms
CircleOptions
?
msCircleOptions
:
CircleOptions
M
?
):
MapOverlay
{
):
MapOverlay
{
val
mapReadView
=
getMapReadView
()
val
mapReadView
=
getMapReadView
()
when
(
MapSdkInit
.
getMapType
())
{
when
(
MapSdkInit
.
getMapType
())
{
...
...
mapapi/src/main/java/com/cusc/map/maps/amap/AmapDrawInMap.kt
View file @
d8a1e0d4
...
@@ -10,7 +10,7 @@ import com.amap.api.maps.model.PolygonOptions
...
@@ -10,7 +10,7 @@ import com.amap.api.maps.model.PolygonOptions
import
com.amap.api.maps.model.PolylineOptions
import
com.amap.api.maps.model.PolylineOptions
import
com.cusc.map.R
import
com.cusc.map.R
import
com.cusc.map.UserCtx
import
com.cusc.map.UserCtx
import
com.cusc.map.maps.
Ms
CircleOptions
import
com.cusc.map.maps.CircleOptions
M
import
com.cusc.map.maps.MsPolygonOptions
import
com.cusc.map.maps.MsPolygonOptions
import
com.cusc.map.maps.MsPolylineOptions
import
com.cusc.map.maps.MsPolylineOptions
import
com.cusc.map.maps.cdata.LatLngM
import
com.cusc.map.maps.cdata.LatLngM
...
@@ -90,7 +90,7 @@ object AmapDrawInMap {
...
@@ -90,7 +90,7 @@ object AmapDrawInMap {
fun
drawCircle
(
fun
drawCircle
(
mapReadView
:
MapReadyView
?,
mapReadView
:
MapReadyView
?,
center
:
LatLngM
,
center
:
LatLngM
,
msCircleOptions
:
Ms
CircleOptions
?
msCircleOptions
:
CircleOptions
M
?
):
MapOverlay
{
):
MapOverlay
{
var
latLng
=
LatLng
(
center
.
lat
,
center
.
lng
)
var
latLng
=
LatLng
(
center
.
lat
,
center
.
lng
)
val
options
=
CircleOptions
()
val
options
=
CircleOptions
()
...
...
mapapi/src/main/java/com/cusc/map/maps/amap/AmapGpsLocation.kt
View file @
d8a1e0d4
...
@@ -5,8 +5,8 @@ import com.amap.api.location.AMapLocationClient
...
@@ -5,8 +5,8 @@ import com.amap.api.location.AMapLocationClient
import
com.amap.api.location.AMapLocationClientOption
import
com.amap.api.location.AMapLocationClientOption
import
com.amap.api.location.AMapLocationListener
import
com.amap.api.location.AMapLocationListener
import
com.cusc.map.UserCtx
import
com.cusc.map.UserCtx
import
com.cusc.map.location.
MS
LocCb
import
com.cusc.map.location.LocCb
M
import
com.cusc.map.location.On
Ms
GpsLoc
import
com.cusc.map.location.OnGpsLoc
/**GPS定位类*/
/**GPS定位类*/
class
AmapGpsLocation
{
class
AmapGpsLocation
{
...
@@ -38,7 +38,7 @@ class AmapGpsLocation {
...
@@ -38,7 +38,7 @@ class AmapGpsLocation {
private
var
alocationClient
:
AMapLocationClient
?
=
null
private
var
alocationClient
:
AMapLocationClient
?
=
null
/**业务层Gps定位回调**/
/**业务层Gps定位回调**/
private
var
onMsGpsLoc
:
On
Ms
GpsLoc
?
=
null
private
var
onMsGpsLoc
:
OnGpsLoc
?
=
null
/**初始化定位*/
/**初始化定位*/
private
fun
initLoc
()
{
private
fun
initLoc
()
{
...
@@ -53,7 +53,7 @@ class AmapGpsLocation {
...
@@ -53,7 +53,7 @@ class AmapGpsLocation {
/**开启定位*/
/**开启定位*/
fun
starLoc
(
onMsGpsLoc
:
On
Ms
GpsLoc
?)
{
fun
starLoc
(
onMsGpsLoc
:
OnGpsLoc
?)
{
this
.
onMsGpsLoc
=
onMsGpsLoc
this
.
onMsGpsLoc
=
onMsGpsLoc
if
(
alocationClient
==
null
)
{
if
(
alocationClient
==
null
)
{
initLoc
()
initLoc
()
...
@@ -85,7 +85,7 @@ class AmapGpsLocation {
...
@@ -85,7 +85,7 @@ class AmapGpsLocation {
//errCode等于0代表定位成功,其他的为定位失败,具体的可以参照官网定位错误码说明
//errCode等于0代表定位成功,其他的为定位失败,具体的可以参照官网定位错误码说明
if
(
location
.
getErrorCode
()
==
0
)
{
if
(
location
.
getErrorCode
()
==
0
)
{
// println("-------高德定位改变 = ${location?.latitude} curLng=${location?.longitude} speed=${location?.speed}")
// println("-------高德定位改变 = ${location?.latitude} curLng=${location?.longitude} speed=${location?.speed}")
var
loc
=
MS
LocCb
.
instance
.
apply
{
var
loc
=
LocCb
M
.
instance
.
apply
{
lat
=
location
?.
latitude
?:
0.0
lat
=
location
?.
latitude
?:
0.0
lng
=
location
?.
longitude
?:
0.0
lng
=
location
?.
longitude
?:
0.0
speed
=
location
?.
speed
?:
0f
speed
=
location
?.
speed
?:
0f
...
...
mapapi/src/main/java/com/cusc/map/maps/mine/MineDrawInMap.kt
View file @
d8a1e0d4
...
@@ -9,7 +9,7 @@ import com.minedata.minenavi.map.PolylineOptions
...
@@ -9,7 +9,7 @@ import com.minedata.minenavi.map.PolylineOptions
import
com.minedata.minenavi.mapdal.LatLng
import
com.minedata.minenavi.mapdal.LatLng
import
com.cusc.map.R
import
com.cusc.map.R
import
com.cusc.map.UserCtx
import
com.cusc.map.UserCtx
import
com.cusc.map.maps.
Ms
CircleOptions
import
com.cusc.map.maps.CircleOptions
M
import
com.cusc.map.maps.MsPolygonOptions
import
com.cusc.map.maps.MsPolygonOptions
import
com.cusc.map.maps.MsPolylineOptions
import
com.cusc.map.maps.MsPolylineOptions
import
com.cusc.map.maps.cdata.LatLngM
import
com.cusc.map.maps.cdata.LatLngM
...
@@ -86,7 +86,7 @@ internal object MineDrawInMap {
...
@@ -86,7 +86,7 @@ internal object MineDrawInMap {
fun
drawCircle
(
fun
drawCircle
(
mapReadView
:
MapReadyView
?,
mapReadView
:
MapReadyView
?,
center
:
LatLngM
,
center
:
LatLngM
,
msCircleOptions
:
Ms
CircleOptions
?
msCircleOptions
:
CircleOptions
M
?
):
MapOverlay
{
):
MapOverlay
{
// 根据地图类型绘制不同类型的圆形
// 根据地图类型绘制不同类型的圆形
var
latLng
=
LatLng
(
center
.
lat
,
center
.
lng
)
var
latLng
=
LatLng
(
center
.
lat
,
center
.
lng
)
...
...
mapapi/src/main/java/com/cusc/map/parkroad/
Ms
ParkRoad.kt
→
mapapi/src/main/java/com/cusc/map/parkroad/ParkRoad
M
.kt
View file @
d8a1e0d4
...
@@ -14,7 +14,7 @@ import com.cusc.map.vms.CarRoadVM
...
@@ -14,7 +14,7 @@ import com.cusc.map.vms.CarRoadVM
/**
/**
* 局部图操作类
* 局部图操作类
*/
*/
object
Ms
ParkRoad
:
MsOperationParent
()
{
object
ParkRoad
M
:
MsOperationParent
()
{
private
var
carRoadVM
:
CarRoadVM
?
=
null
private
var
carRoadVM
:
CarRoadVM
?
=
null
...
...
mapapi/src/main/java/com/cusc/map/scenario/CucsVehicle.kt
View file @
d8a1e0d4
...
@@ -3,7 +3,7 @@ package com.cusc.map.scenario
...
@@ -3,7 +3,7 @@ package com.cusc.map.scenario
import
com.cusc.map.MAP_TYPE
import
com.cusc.map.MAP_TYPE
import
com.cusc.map.MapSdkInit
import
com.cusc.map.MapSdkInit
import
com.cusc.map.highmap.CarNavPath
import
com.cusc.map.highmap.CarNavPath
import
com.cusc.map.highmap.HighMap
import
com.cusc.map.highmap.
Three
HighMap
import
com.cusc.map.scenario.bean.VehiclePos
import
com.cusc.map.scenario.bean.VehiclePos
import
com.cusc.map.scenario.mine.AmapVehMove
import
com.cusc.map.scenario.mine.AmapVehMove
import
com.cusc.map.scenario.mine.MineVehMove
import
com.cusc.map.scenario.mine.MineVehMove
...
@@ -81,7 +81,7 @@ object CucsVehicle {
...
@@ -81,7 +81,7 @@ object CucsVehicle {
* @param carNavPath
* @param carNavPath
*/
*/
fun
setCarNaiPath
(
carNavPath
:
CarNavPath
)
{
fun
setCarNaiPath
(
carNavPath
:
CarNavPath
)
{
HighMap
.
setCarNavPath
(
carNavPath
)
Three
HighMap
.
setCarNavPath
(
carNavPath
)
}
}
/**
/**
...
@@ -89,7 +89,7 @@ object CucsVehicle {
...
@@ -89,7 +89,7 @@ object CucsVehicle {
*/
*/
fun
clearCarNaiPath
()
{
fun
clearCarNaiPath
()
{
var
carNavPath
=
CarNavPath
()
var
carNavPath
=
CarNavPath
()
HighMap
.
setCarNavPath
(
carNavPath
)
Three
HighMap
.
setCarNavPath
(
carNavPath
)
}
}
...
...
mapapi/src/main/java/com/cusc/map/scenario/PerceptionManager.kt
View file @
d8a1e0d4
...
@@ -2,9 +2,9 @@ package com.cusc.map.scenario
...
@@ -2,9 +2,9 @@ package com.cusc.map.scenario
import
com.cusc.map.MAP_TYPE
import
com.cusc.map.MAP_TYPE
import
com.cusc.map.MapSdkInit
import
com.cusc.map.MapSdkInit
import
com.cusc.map.highmap.HighMap
import
com.cusc.map.highmap.
Three
HighMap
import
com.cusc.map.highmap.UnityPtc
import
com.cusc.map.highmap.UnityPtc
import
com.cusc.map.parkroad.
Ms
ParkRoad
import
com.cusc.map.parkroad.ParkRoad
M
import
com.cusc.map.parkroad.PtcBean
import
com.cusc.map.parkroad.PtcBean
import
com.cusc.map.scenario.bean.Percept
import
com.cusc.map.scenario.bean.Percept
...
@@ -45,7 +45,7 @@ object PerceptionManager {
...
@@ -45,7 +45,7 @@ object PerceptionManager {
heading
=
it
.
heading
heading
=
it
.
heading
}
}
}
}
Ms
ParkRoad
.
upDatePreTarget
(
pres
)
ParkRoad
M
.
upDatePreTarget
(
pres
)
}
}
//刷新高精图感知物
//刷新高精图感知物
...
@@ -59,15 +59,15 @@ object PerceptionManager {
...
@@ -59,15 +59,15 @@ object PerceptionManager {
heading
=
it
.
heading
heading
=
it
.
heading
}
}
}
}
HighMap
.
setPtcData
(
pres
)
Three
HighMap
.
setPtcData
(
pres
)
}
}
/***清除所有感知物**/
/***清除所有感知物**/
fun
clearAllPerception
()
{
fun
clearAllPerception
()
{
when
(
MapSdkInit
.
getMapType
())
{
when
(
MapSdkInit
.
getMapType
())
{
MAP_TYPE
.
MINE
->
{
MAP_TYPE
.
MINE
->
{
Ms
ParkRoad
.
clearAllTargets
()
ParkRoad
M
.
clearAllTargets
()
HighMap
.
setPtcData
(
emptyList
())
Three
HighMap
.
setPtcData
(
emptyList
())
}
}
MAP_TYPE
.
AMAP
->
{
MAP_TYPE
.
AMAP
->
{
...
...
mapapi/src/main/java/com/cusc/map/scenario/V2xWarn.kt
View file @
d8a1e0d4
package
com.cusc.map.scenario
package
com.cusc.map.scenario
import
com.example.car_and_road_3d.models.Alarm
import
com.example.car_and_road_3d.models.Alarm
import
com.cusc.map.highmap.HighMap
import
com.cusc.map.highmap.
Three
HighMap
import
com.cusc.map.highmap.WarnPtc
import
com.cusc.map.highmap.WarnPtc
import
com.cusc.map.parkroad.
Ms
ParkRoad
import
com.cusc.map.parkroad.ParkRoad
M
import
kotlinx.coroutines.CoroutineScope
import
kotlinx.coroutines.CoroutineScope
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.delay
import
kotlinx.coroutines.delay
...
@@ -46,8 +46,8 @@ object V2xWarn {
...
@@ -46,8 +46,8 @@ object V2xWarn {
it
.
isAlarm
=
false
it
.
isAlarm
=
false
it
.
time
=
0
it
.
time
=
0
}
}
HighMap
.
setWarnPtc
(
warnPtcs
)
Three
HighMap
.
setWarnPtc
(
warnPtcs
)
Ms
ParkRoad
.
warnAlerms
(
alarms
)
ParkRoad
M
.
warnAlerms
(
alarms
)
warnPtcs
.
clear
()
warnPtcs
.
clear
()
alarms
.
clear
()
alarms
.
clear
()
}
}
...
@@ -76,21 +76,21 @@ object V2xWarn {
...
@@ -76,21 +76,21 @@ object V2xWarn {
})
})
}
}
//高精图预警
//高精图预警
HighMap
.
setWarnPtc
(
warnPtcs
)
Three
HighMap
.
setWarnPtc
(
warnPtcs
)
CoroutineScope
(
Dispatchers
.
Main
).
launch
{
CoroutineScope
(
Dispatchers
.
Main
).
launch
{
HighMap
.
setCarRadarDirection
(
dirent
)
Three
HighMap
.
setCarRadarDirection
(
dirent
)
HighMap
.
setCarBottomCircle
(
true
)
Three
HighMap
.
setCarBottomCircle
(
true
)
delay
(
5000
)
delay
(
5000
)
HighMap
.
setCarBottomCircle
(
false
)
Three
HighMap
.
setCarBottomCircle
(
false
)
HighMap
.
setCarRadarDirection
(
0
)
Three
HighMap
.
setCarRadarDirection
(
0
)
}
}
//局部图预警
//局部图预警
Ms
ParkRoad
.
warnAlerms
(
alarms
)
ParkRoad
M
.
warnAlerms
(
alarms
)
CoroutineScope
(
Dispatchers
.
Main
).
launch
{
CoroutineScope
(
Dispatchers
.
Main
).
launch
{
Ms
ParkRoad
.
toggleRadar
(
true
)
ParkRoad
M
.
toggleRadar
(
true
)
delay
(
5000
)
delay
(
5000
)
Ms
ParkRoad
.
toggleRadar
(
false
)
ParkRoad
M
.
toggleRadar
(
false
)
}
}
}
}
...
@@ -99,7 +99,7 @@ object V2xWarn {
...
@@ -99,7 +99,7 @@ object V2xWarn {
* @param marker 1:结冰 2:施工 3:交叉路口慢行
* @param marker 1:结冰 2:施工 3:交叉路口慢行
* */
* */
fun
setWarnMark
(
mark
:
Int
)
{
fun
setWarnMark
(
mark
:
Int
)
{
Ms
ParkRoad
.
showMarker
(
mark
)
ParkRoad
M
.
showMarker
(
mark
)
}
}
}
}
\ No newline at end of file
mapapi/src/main/java/com/cusc/map/scenario/mine/MineVehMove.kt
View file @
d8a1e0d4
package
com.cusc.map.scenario.mine
package
com.cusc.map.scenario.mine
import
com.minedata.minenavi.mapdal.LatLng
import
com.minedata.minenavi.mapdal.LatLng
import
com.cusc.map.highmap.HighMap
import
com.cusc.map.highmap.
Three
HighMap
import
com.cusc.map.highmap.HighPos
import
com.cusc.map.highmap.HighPos
import
com.cusc.map.maps.Navigate
import
com.cusc.map.maps.Navigate
import
com.cusc.map.maps.MethodAdv
import
com.cusc.map.maps.MethodAdv
import
com.cusc.map.parkroad.
Ms
ParkRoad
import
com.cusc.map.parkroad.ParkRoad
M
import
com.cusc.map.parkroad.RoadPos
import
com.cusc.map.parkroad.RoadPos
import
com.cusc.map.scenario.CucsVehicle
import
com.cusc.map.scenario.CucsVehicle
import
com.cusc.map.scenario.VehicleModel
import
com.cusc.map.scenario.VehicleModel
...
@@ -42,14 +42,14 @@ internal object MineVehMove {
...
@@ -42,14 +42,14 @@ internal object MineVehMove {
lon
=
vPos
.
lng
lon
=
vPos
.
lng
evel
=
vPos
.
evel
evel
=
vPos
.
evel
}
}
HighMap
.
setCarPosition
(
highPos
)
Three
HighMap
.
setCarPosition
(
highPos
)
}
else
if
(
moveType
==
2
)
{
}
else
if
(
moveType
==
2
)
{
var
roadPos
=
RoadPos
.
instance
.
apply
{
var
roadPos
=
RoadPos
.
instance
.
apply
{
lat
=
vPos
.
lat
lat
=
vPos
.
lat
lng
=
vPos
.
lng
lng
=
vPos
.
lng
bearing
=
vPos
.
heading
.
toFloat
()
bearing
=
vPos
.
heading
.
toFloat
()
}
}
Ms
ParkRoad
.
updateMainCar
(
roadPos
,
null
)
ParkRoad
M
.
updateMainCar
(
roadPos
,
null
)
}
else
if
(
moveType
==
3
)
{
}
else
if
(
moveType
==
3
)
{
if
(
Navigate
.
isStartNai
)
{
//导航中就删除在线地图小车
if
(
Navigate
.
isStartNai
)
{
//导航中就删除在线地图小车
CucsVehicle
.
deleteCarModel
()
CucsVehicle
.
deleteCarModel
()
...
...
mapapi/src/main/java/com/cusc/map/ui/MineNaiDirActivity.kt
View file @
d8a1e0d4
...
@@ -27,9 +27,9 @@ import com.cusc.map.maps.mine.MineNaiParams
...
@@ -27,9 +27,9 @@ import com.cusc.map.maps.mine.MineNaiParams
import
com.cusc.map.maps.mine.MineRoutePlans
import
com.cusc.map.maps.mine.MineRoutePlans
import
com.cusc.map.intfaces.OnComCan
import
com.cusc.map.intfaces.OnComCan
import
com.cusc.map.intfaces.OnNaviPresenterListener
import
com.cusc.map.intfaces.OnNaviPresenterListener
import
com.cusc.map.location.
MS
LocCb
import
com.cusc.map.location.LocCb
M
import
com.cusc.map.location.
MS
Location
import
com.cusc.map.location.Location
M
import
com.cusc.map.location.On
Ms
GpsLoc
import
com.cusc.map.location.OnGpsLoc
import
com.cusc.map.maps.Navigate
import
com.cusc.map.maps.Navigate
import
com.cusc.map.maps.PathPlanning
import
com.cusc.map.maps.PathPlanning
import
com.cusc.map.ui.MapView.OnMapReadyLis
import
com.cusc.map.ui.MapView.OnMapReadyLis
...
@@ -68,8 +68,8 @@ class MineNaiDirActivity : AppCompatActivity(), OnNaviPresenterListener {
...
@@ -68,8 +68,8 @@ class MineNaiDirActivity : AppCompatActivity(), OnNaviPresenterListener {
//开启定位
//开启定位
MS
Location
.
startLoc
(
object
:
On
Ms
GpsLoc
{
Location
M
.
startLoc
(
object
:
OnGpsLoc
{
override
fun
onMsGpsLoc
(
mSLocBean
:
MS
LocCb
)
{
override
fun
onMsGpsLoc
(
mSLocBean
:
LocCb
M
)
{
println
(
"---------mSLocBean = ${mSLocBean.lng}"
)
println
(
"---------mSLocBean = ${mSLocBean.lng}"
)
}
}
})
})
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment