更新历史轨迹列表数据7

master
tangwenkang 2023-12-02 09:15:41 +08:00
parent 70e510e290
commit 016bd5d71b
1 changed files with 7 additions and 27 deletions

View File

@ -1,6 +1,7 @@
<script >
import AMapLoader from '@amap/amap-jsapi-loader';
import {deleteRecord, getList, historyMap} from "@/api/table";
import data from "@/views/system/dict/data.vue";
export default {
components: {},
props: {},
@ -17,27 +18,7 @@ export default {
endTime:null
},
arr:[],
lineArr: [
// [116.478935,39.997761],
// [116.478939,39.997825],
// [116.478912,39.998549],
// [116.478912,39.998549],
// [116.478998,39.998555],
// [116.478998,39.998555],
// [116.479282,39.99856],
// [116.479658,39.998528],
// [116.480151,39.998453],
// [116.480784,39.998302],
// [116.480784,39.998302],
// [116.481149,39.998184],
// [116.481573,39.997997],
// [116.481863,39.997846],
// [116.482072,39.997718],
// [116.482362,39.997718],
// [116.483633,39.998935],
// [116.48367,39.998968],
// [116.484648,39.999861]
],
lineArr:null
}
},
mounted() {
@ -63,16 +44,15 @@ export default {
this.recordCar.startTime = recordCar.startTime
this.recordCar.endTime = recordCar.endTime
historyMap(this.recordCar).then(res=>{
console.log(res.data)
res.data.forEach(item=>{
this.arr[0] = item.longitude
this.arr[1] = item.latitude
this.coordinates.map(this.arr);
this.lineArr.push(this.arr)
this.arr.push(item.longitude.replace(/"/g, "") +","+item.latitude.replace(/"/g, ""))
console.log(this.arr)
const result = this.arr.map(item => item.trim().replace(/'/g, '').split(','));
console.log(result)
this.lineArr = result
console.log(this.lineArr)
})
})
this.initMap()
this.startAnimation()
},