小车动画完善

This commit is contained in:
Shikong 2023-05-19 02:22:56 +08:00
parent 9122f3be17
commit e0231ffda6

View File

@ -14,14 +14,19 @@ export function playAnimation(map,data,line){
return new AMap.LngLat(item.longitude, item.latitude)
})
let index = 0
data.animateMarker.stopMove();
data.animateMarker.on("movealong",()=>{
// map.add(data.animateMarker)
})
data.animateMarker.on("moveend",()=>{
// setTimeout(()=>{
// map.remove(data.animateMarker)
// },100)
index++
if(index === line.length-1){
setTimeout(()=>{
map.remove(data.animateMarker)
},100)
}
})
let polyline = new AMap.Polyline({
path: path,