更新实时轨迹7

master
tangwenkang 2023-12-03 20:58:29 +08:00
parent 690531cd40
commit 15f2ab96da
1 changed files with 12 additions and 4 deletions

View File

@ -19,13 +19,14 @@ export default {
},
arr:[],
lineArr:null,
carMsg:[]
carMsg:[],
currentIndex:0 ,//
currentObject: null, //
timer: null //
}
},
mounted() {
setInterval(() => {
this.historyMap();
}, 1000);
},
created() {
this.getList()
@ -58,6 +59,13 @@ export default {
})
this.initMap()
this.startAnimation()
this.currentObject = this.carMsg[this.currentIndex]; //
//
this.timer = setInterval(() => {
this.currentIndex = (this.currentIndex + 1) % this.carMsg.length; //
this.currentObject = this.carMsg[this.currentIndex]; //
}, 1000);
},
initMap() {
AMapLoader.load({