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
aeedd7a4
Commit
aeedd7a4
authored
Oct 17, 2025
by
p x
Browse files
测试感知物加载
parent
4f89f2a9
Changes
10
Hide whitespace changes
Inline
Side-by-side
app/src/main/assets/car.glb
0 → 100644
View file @
aeedd7a4
File added
app/src/main/assets/passenger.glb
0 → 100644
View file @
aeedd7a4
File added
app/src/main/assets/
models/
truck.glb
→
app/src/main/assets/truck.glb
View file @
aeedd7a4
File moved
app/src/main/java/com/sd/demo/ui/PartRoadActivity.kt
View file @
aeedd7a4
...
...
@@ -8,6 +8,7 @@ import com.minedata.minenavi.mapdal.LatLng
import
com.sd.api.bean.MyCLoc
import
com.sd.api.parkroad.MsParkRoad
import
com.sd.api.parkroad.OnPrAddCar
import
com.sd.api.parkroad.PartType
import
com.sd.api.parkroad.PtcBean
import
com.sd.api.ui.MapMultiView.OnMapReadyLis
import
com.sd.api.ui.MapReadyView
...
...
@@ -35,13 +36,14 @@ class PartRoadActivity : AppCompatActivity() {
binding
.
mapMultiView
.
addMapRenderCallback
(
object
:
OnMapReadyLis
{
override
fun
onMapReady
(
mapReadyView
:
MapReadyView
)
{
this
@PartRoadActivity
.
mapReadView
=
mapReadyView
MsParkRoad
.
setCarRoadVM
(
mapReadyView
)
}
})
setLis
()
}
private
fun
setLis
()
{
MsParkRoad
.
preloadMainCar
(
assets
,
"models/truck.glb"
)
//
MsParkRoad.preloadMainCar(assets, "models/truck.glb")
//主车移动
binding
.
bt1
.
setOnClickListener
{
mockFzLine
()
...
...
@@ -105,9 +107,15 @@ class PartRoadActivity : AppCompatActivity() {
// MsParkRoad.warnAlerm("50332456-3030-3030-3530-303334533954", true, 5)
MsParkRoad
.
clearAllTargets
()
}
//预加载
模型
//预加载
主车
binding
.
bt11
.
setOnClickListener
{
MsParkRoad
.
preloadMainCar
(
assets
,
"models/truck.glb"
)
// println("-----点击预加载模型")
MsParkRoad
.
preloadMainCar
(
assets
,
"car.glb"
)
}
//预加载感知物
binding
.
bt12
.
setOnClickListener
{
MsParkRoad
.
preloadParticipant
(
assets
,
"truck.glb"
,
PartType
.
CAR
)
MsParkRoad
.
preloadParticipant
(
assets
,
"passenger.glb"
,
PartType
.
PEOPLE
)
}
}
...
...
@@ -141,7 +149,7 @@ class PartRoadActivity : AppCompatActivity() {
}
//地图底图,当前位置,主车是否添加回调
MsParkRoad
.
updateMainCar
(
mapReadView
,
MyCLoc
.
instance
,
object
:
OnPrAddCar
{
MsParkRoad
.
updateMainCar
(
MyCLoc
.
instance
,
object
:
OnPrAddCar
{
override
fun
onPrAddCar
(
isAdd
:
Boolean
)
{
println
(
"------------isAdd = ${isAdd}"
)
}
...
...
app/src/main/res/layout/activity_part_road.xml
View file @
aeedd7a4
...
...
@@ -80,8 +80,13 @@
android:id=
"@+id/bt11"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"预加载
模型
"
/>
android:text=
"预加载
主车
"
/>
<Button
android:id=
"@+id/bt12"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"预加载参与者"
/>
</LinearLayout>
...
...
mapapi/src/main/assets/truck.glb
0 → 100644
View file @
aeedd7a4
File added
mapapi/src/main/java/com/sd/api/fragments/PartRoadFragment.kt
View file @
aeedd7a4
...
...
@@ -52,7 +52,9 @@ class PartRoadFragment : Fragment() {
setDebugLogging
(
true
)
setWebViewLogging
(
true
)
}
MsParkRoad
.
preloadMainCar
(
requireActivity
().
assets
,
"truck.glb"
)
// carRoadVM.webViewClient?.preloadMainCar(requireActivity().assets.open("truck.glb")) { v: Boolean ->
// println("-----------v = ${v}")
// }
MapReadyView
.
instance
.
carRoadVM
=
carRoadVM
onMapReadyLis
?.
onMapReady
(
MapReadyView
.
instance
)
}
...
...
mapapi/src/main/java/com/sd/api/parkroad/MsParkRoad.kt
View file @
aeedd7a4
...
...
@@ -15,10 +15,14 @@ import com.sd.api.vms.CarRoadVM
object
MsParkRoad
{
private
var
carRoadVM
:
CarRoadVM
?
=
null
fun
updateMainCar
(
mapReadyView
:
MapReadyView
?,
myloc
:
MyCLoc
,
onPrAddCar
:
OnPrAddCar
?)
{
fun
setCarRoadVM
(
mapReadyView
:
MapReadyView
?)
{
if
(
mapReadyView
==
null
)
return
carRoadVM
=
mapReadyView
.
carRoadVM
carRoadVM
=
mapReadyView
?.
carRoadVM
}
fun
updateMainCar
(
myloc
:
MyCLoc
,
onPrAddCar
:
OnPrAddCar
?)
{
carRoadVM
?.
updateMainCar
(
myloc
,
onPrAddCar
)
}
...
...
@@ -102,11 +106,27 @@ object MsParkRoad {
carRoadVM
?.
webViewClient
?.
clearAllTargets
(
null
)
}
/**预加载
模型
***/
/**预加载
主车
***/
fun
preloadMainCar
(
assets
:
AssetManager
,
fileName
:
String
)
{
println
(
"-----预加载模型"
)
carRoadVM
?.
webViewClient
?.
preloadMainCar
(
assets
.
open
(
fileName
))
{
v
:
Boolean-
>
println
(
"------preloadMainCar = ${v}"
)
carRoadVM
?.
webViewClient
?.
preloadMainCar
(
assets
.
open
(
fileName
))
{
v
:
Boolean
->
println
(
"-------preloadMainCar = ${v}"
)
}
}
/**预加载感知物***/
fun
preloadParticipant
(
assets
:
AssetManager
,
fileName
:
String
,
ptcType
:
PartType
)
{
if
(
ptcType
==
PartType
.
CAR
)
{
carRoadVM
?.
webViewClient
?.
preloadParticipant
(
Participant
.
ParticipantType
.
CAR
,
assets
.
open
(
fileName
)
)
{
v
:
Boolean
->
println
(
"-------------preloadParticipant = ${v}"
)
}
}
else
if
(
ptcType
==
PartType
.
PEOPLE
)
{
carRoadVM
?.
webViewClient
?.
preloadParticipant
(
Participant
.
ParticipantType
.
PEOPLE
,
assets
.
open
(
fileName
)
)
{
}
}
}
...
...
mapapi/src/main/java/com/sd/api/parkroad/PartType.kt
0 → 100644
View file @
aeedd7a4
package
com.sd.api.parkroad
/**参与者枚举**/
enum
class
PartType
{
CAR
,
PEOPLE
}
\ No newline at end of file
mapapi/src/main/java/com/sd/api/ui/MapReadyView.kt
View file @
aeedd7a4
package
com.sd.api.ui
import
com.amap.api.maps.AMap
import
com.example.car_and_road_3d.CarAndRoadWebViewClient
import
com.minedata.minenavi.map.MapView
import
com.minedata.minenavi.map.MineMap
import
com.sd.api.vms.CarRoadVM
...
...
@@ -17,11 +16,12 @@ class MapReadyView private constructor() {
/**四维在线地图容器*/
var
fMapView
:
MapView
?
=
null
/**四维在线地图*/
var
mMineMap
:
MineMap
?
=
null
//四维局部图操作类
var
carRoadVM
:
CarRoadVM
?
=
null
var
carRoadVM
:
CarRoadVM
?
=
null
/**高德在线地图*/
var
aMap
:
AMap
?
=
null
...
...
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