Commit 8210b60b authored by 耿迪迪's avatar 耿迪迪

车辆信息 轨迹问题修改 gengdidi

parent 413e4894
......@@ -700,9 +700,8 @@ export class EditorMap {
strokeWeight: 6, //线宽
});
marker.on("moving", (e) => {
marker.passedPolyline.setPath(e.passedPath);
this.map.setCenter(e.target.getPosition(), true);
console.log(marker.passedPolyline)
marker.passedPolyline.setPath(e.passedPath);
// this.map.setCenter(e.target.getPosition(), true);
});
marker.moveAlong(path , {
......
......@@ -310,10 +310,11 @@ export default {
let param = {};
param.vehicleId = row.vehicleId;
this.backForm.vehicleId = row.vehicleId;
getLastLocation(param).then(res =>{
return getLastLocation(param).then(res =>{
if(res){
if(res.data.longitude && res.data.latitude){
res.data.iconType = 9;
res.data.count=1;
this.map.clearbackTrack(param.vehicleId)
this.map.addDevice(res.data,MapCar);
this.map.map.panTo([res.data.longitude, res.data.latitude]);
......@@ -385,8 +386,8 @@ export default {
this.queryParams.carNum = null;
this.getList();
},
searchLocations(){
this.$refs.backForm.validate((valid) => {
searchLocations(){
this.$refs.backForm.validate(async (valid) => {
if (valid) {
if (
moment(this.backForm.beginTime).valueOf() >
......@@ -406,8 +407,13 @@ export default {
"YYYY-MM-DD HH:mm:ss"
);
}
getVehicleLocations(this.backForm).then(res =>{
if(this.map.allDevice[9][0].getExtData().count>1){
this.map.clearbackTrack();
await this.getVehicleTravel({vehicleId:this.backForm.vehicleId});
}else{
this.map.allDevice[9][0].getExtData().count++
}
getVehicleLocations(this.backForm).then(res =>{
let paths = [];
if(res.data.length == 1){
this.$message({
......@@ -430,8 +436,12 @@ export default {
})
}
});
},
sleep (time) {
return new Promise((resolve) => setTimeout(resolve, time));
}
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment