Commit e1d2864a by zhangquan

地图优化

1 parent d386b334
......@@ -255,7 +255,8 @@ export default {
res.acciTime = res.collisionTime ? dayjs(res.collisionTime).format('YYYY-MM-DD HH:mm:ss') : ''
this.detailDataObj = res
if(!res.carAddressList?.length) return this.showMap = false
this.handleData(res.carAddressList, res.collisionTime)
const addr = [res.longitude? +res.longitude : 0, res.latitude? +res.latitude : 0]
this.handleData(res.carAddressList, res.collisionTime, addr)
}
})
},
......@@ -266,7 +267,7 @@ export default {
}
this.recordVisible = true
},
handleData(list, collTime){
handleData(list, collTime , addr){
let xList = [], yList = [], lineList = [], mapLnglatList=[];
let startAddr = [], pointAddr = [], endAddr = [];
const time = dayjs(collTime).format('HH:mm:ss')
......@@ -302,7 +303,7 @@ export default {
}
})
this.drawLine(xList, yList, lineList)
this.initMap(mapLnglatList, startAddr, pointAddr, endAddr)
this.initMap(mapLnglatList, startAddr, addr, endAddr)
},
drawLine(xList, yList, lineList){
// 基于准备好的dom,初始化echarts实例
......@@ -384,6 +385,11 @@ export default {
center: startAddr // 初始地图中心点坐标
});
// 添加缩放控件
map.plugin(["AMap.ToolBar"], function() {
var toolbar = new AMap.ToolBar();
map.addControl(toolbar);
});
// 自定义起点图标
var startPointIcon = new AMap.Icon({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!