fix:修复车船gps运动错误的问题

This commit is contained in:
zjc
2025-01-26 15:55:23 +08:00
parent 21fb9a9c59
commit 72d26075e9
2 changed files with 10 additions and 10 deletions

View File

@@ -326,7 +326,7 @@
import PubSub from 'pubsub-js'
const scenicStore = useScenicStore()
const { initMap, addMarker } = useMap()
const { initMap, addMarker, clearOverlays } = useMap()
const garageList = computed(() => {
return scenicStore.stopCarData.headList
@@ -383,20 +383,19 @@
watch(
() => scenicStore.carShipData,
(val) => {
if (val.car.list.length) {
setTimeout(() => {
setTimeout(() => {
clearOverlays()
if (val.car.list.length) {
val.car.list.map((item) => {
addMarker(carIcon, [item.lng, item.lat], [36, 50])
})
}, 1000)
}
if (val.ship.list.length) {
setTimeout(() => {
}
if (val.ship.list.length) {
val.ship.list.map((item) => {
addMarker(shipIcon, [item.lng, item.lat], [36, 50])
})
}, 1000)
}
}
}, 1000)
},
{ immediate: true }
)