历史轨迹更新
parent
45c1a5a1f2
commit
40a711b5ca
|
@ -43,3 +43,4 @@ export function insertCar(carInsert) {
|
||||||
data:carInsert
|
data:carInsert
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,7 @@ export default {
|
||||||
equipmentId: String,
|
equipmentId: String,
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.map && this.map.destroy();//离开页面,销毁掉
|
// this.map && this.map.destroy();//离开页面,销毁掉
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -265,8 +265,7 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initMap()
|
|
||||||
this.startAnimation()
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList()
|
this.getList()
|
||||||
|
@ -289,6 +288,8 @@ export default {
|
||||||
isShowAll(){
|
isShowAll(){
|
||||||
this.isShow = true
|
this.isShow = true
|
||||||
this.isList = false
|
this.isList = false
|
||||||
|
// this.map.destroy();//离开页面,销毁掉
|
||||||
|
location.reload()
|
||||||
},
|
},
|
||||||
insertCar(){
|
insertCar(){
|
||||||
insertCar(this.carInsert).then(res=>{
|
insertCar(this.carInsert).then(res=>{
|
||||||
|
@ -316,6 +317,8 @@ export default {
|
||||||
realTimeTrajectory(){
|
realTimeTrajectory(){
|
||||||
this.isShow = false
|
this.isShow = false
|
||||||
this.isList = true
|
this.isList = true
|
||||||
|
this.initMap()
|
||||||
|
this.startAnimation()
|
||||||
},
|
},
|
||||||
/*刷新*/
|
/*刷新*/
|
||||||
refreshTable(){
|
refreshTable(){
|
||||||
|
@ -386,7 +389,7 @@ export default {
|
||||||
zoomEnable: true, // 地图是否可缩放,默认值为true
|
zoomEnable: true, // 地图是否可缩放,默认值为true
|
||||||
dragEnable: true, // 地图是否可通过鼠标拖拽平移,默认为true
|
dragEnable: true, // 地图是否可通过鼠标拖拽平移,默认为true
|
||||||
doubleClickZoom: true, // 地图是否可通过双击鼠标放大地图,默认为true
|
doubleClickZoom: true, // 地图是否可通过双击鼠标放大地图,默认为true
|
||||||
zoom: 13, //初始化地图级别
|
zoom: 17, //初始化地图级别
|
||||||
center: this.lineArr[0], // 初始化中心点坐标 北京
|
center: this.lineArr[0], // 初始化中心点坐标 北京
|
||||||
// mapStyle: "amap://styles/darkblue", // 设置颜色底层
|
// mapStyle: "amap://styles/darkblue", // 设置颜色底层
|
||||||
})
|
})
|
||||||
|
@ -418,13 +421,14 @@ export default {
|
||||||
|
|
||||||
// 监听marker移动
|
// 监听marker移动
|
||||||
this.marker.on('moving', (e) => {
|
this.marker.on('moving', (e) => {
|
||||||
console.log('marker动了', e)
|
|
||||||
this.passedPolyline.setPath(e.passedPath); // 设置路径样式
|
this.passedPolyline.setPath(e.passedPath); // 设置路径样式
|
||||||
this.map.setCenter(e.target.getPosition(), true) // 设置地图中心点
|
this.map.setCenter(e.target.getPosition(), true) // 设置地图中心点
|
||||||
});
|
});
|
||||||
|
|
||||||
this.map.setFitView(); // 根据覆盖物自适应展示地图
|
this.map.setFitView(); // 根据覆盖物自适应展示地图
|
||||||
|
|
||||||
|
}).catch(e => {
|
||||||
|
console.log(e)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
startAnimation () {
|
startAnimation () {
|
||||||
|
|
Loading…
Reference in New Issue