Commit bffc5c55 authored by 耿迪迪's avatar 耿迪迪

车辆信息 gengdidi

parent c493ac1b
...@@ -707,7 +707,7 @@ export class EditorMap { ...@@ -707,7 +707,7 @@ export class EditorMap {
marker.moveAlong(path , { marker.moveAlong(path , {
// 每一段的时长 // 每一段的时长
duration: 800,//可根据实际采集时间间隔设置 duration: 8000,//可根据实际采集时间间隔设置
// JSAPI2.0 是否延道路自动设置角度在 moveAlong 里设置 // JSAPI2.0 是否延道路自动设置角度在 moveAlong 里设置
autoRotation: true, autoRotation: true,
}); });
......
...@@ -312,11 +312,17 @@ export default { ...@@ -312,11 +312,17 @@ export default {
this.backForm.vehicleId = row.vehicleId; this.backForm.vehicleId = row.vehicleId;
getLastLocation(param).then(res =>{ getLastLocation(param).then(res =>{
if(res){ if(res){
console.log(res.data.longitude && res.data.latitude,"fdsfdsa")
if(res.data.longitude && res.data.latitude){
res.data.iconType = 9; res.data.iconType = 9;
this.map.clearbackTrack(param.vehicleId) this.map.clearbackTrack(param.vehicleId)
if(res.data.longitude && res.data.latitude){
this.map.addDevice(res.data,MapCar); this.map.addDevice(res.data,MapCar);
this.map.map.panTo([res.data.longitude, res.data.latitude]); this.map.map.panTo([res.data.longitude, res.data.latitude]);
}else{
this.$message({
message: '抱歉未获取到当前车辆位置信息!',
type: 'warning'
});
} }
} }
}); });
...@@ -382,14 +388,19 @@ export default { ...@@ -382,14 +388,19 @@ export default {
}, },
searchLocations(){ searchLocations(){
getVehicleLocations(this.backForm).then(res =>{ getVehicleLocations(this.backForm).then(res =>{
console.log(res,"-------------ffffffffffffff")
let paths = []; let paths = [];
if(res.data.length == 1){
this.$message({
message: '抱歉当前车辆只能查看位置信息,无法形成轨迹!',
type: 'warning'
});
}else{
res.data.forEach(item => { res.data.forEach(item => {
console.log(item,"-------------ffffffffffffff")
paths.push([item.longitude,item.latitude]); paths.push([item.longitude,item.latitude]);
}) })
this.map.backTrack(this.backForm.vehicleId,paths); this.map.backTrack(this.backForm.vehicleId,paths);
this.backOpen = false; this.backOpen = false;
}
}) })
} }
......
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