Commit 05befc34 by wangzhihui

fixed

1 parent b2cb5f3b
...@@ -43,7 +43,7 @@ h3.uimap-info-title{ ...@@ -43,7 +43,7 @@ h3.uimap-info-title{
background-color: #fff; background-color: #fff;
border-radius: 4px; border-radius: 4px;
border: 1px solid #eee; // border: 1px solid #eee;
.tit{ .tit{
padding: 10px 15px; padding: 10px 15px;
} }
......
...@@ -228,7 +228,7 @@ export default { ...@@ -228,7 +228,7 @@ export default {
}, },
methods: { methods: {
async initBMap() { async initBMap() {
console.log(11111111111); // console.log(11111111111);
this.mapObj = await mapService.init("map"); this.mapObj = await mapService.init("map");
this.mapLoading = false; this.mapLoading = false;
window.AMap = this.mapObj; window.AMap = this.mapObj;
...@@ -303,7 +303,7 @@ export default { ...@@ -303,7 +303,7 @@ export default {
{ {
isOpen: true, // 是否开启绘制模式 isOpen: true, // 是否开启绘制模式
enableDrawingTool: false, enableDrawingTool: false,
enableCalculate: true, // 绘制是否进行测距测面 // enableCalculate: true, // 绘制是否进行测距测面
enableSorption: true, // 是否开启边界吸附功能 enableSorption: true, // 是否开启边界吸附功能
sorptiondistance: 20, // 边界吸附距离 sorptiondistance: 20, // 边界吸附距离
circleOptions: styleOptions, // 圆的样式 circleOptions: styleOptions, // 圆的样式
...@@ -382,7 +382,7 @@ export default { ...@@ -382,7 +382,7 @@ export default {
southWest.lat, southWest.lat,
northEast.lng northEast.lng
); // 南到北的距离 ); // 南到北的距离
console.log(width, height); // console.log(width, height);
this.rectangleHeight = width.toFixed(0); this.rectangleHeight = width.toFixed(0);
this.rectangleWidth = height.toFixed(0); this.rectangleWidth = height.toFixed(0);
}, },
......
...@@ -279,7 +279,6 @@ MapService.prototype = { ...@@ -279,7 +279,6 @@ MapService.prototype = {
return Circle return Circle
}, },
createInfoWindow(marker, map, div, isInfoOpen, isInfoAutoMove) { createInfoWindow(marker, map, div, isInfoOpen, isInfoAutoMove) {
console.log(div,'div')
var self = this; var self = this;
var infoWindow=self.map.invoke('InfoWindow',div,{ var infoWindow=self.map.invoke('InfoWindow',div,{
enableAutoPan:!!isInfoAutoMove enableAutoPan:!!isInfoAutoMove
......
...@@ -60,6 +60,8 @@ const replay = { ...@@ -60,6 +60,8 @@ const replay = {
replay.distance=replay.dis.reduce(function (prev, cur, index, arr) { replay.distance=replay.dis.reduce(function (prev, cur, index, arr) {
return prev + cur; return prev + cur;
}); });
console.log(replay.distance,9999999)
if(replay.distance){
replay.distance=replay.distance/1000//算出轨迹的距离(km) replay.distance=replay.distance/1000//算出轨迹的距离(km)
const firstItem = replay.data[0]; const firstItem = replay.data[0];
replay.navg= AMap.invoke('LuShu', replayData, { replay.navg= AMap.invoke('LuShu', replayData, {
...@@ -84,6 +86,19 @@ const replay = { ...@@ -84,6 +86,19 @@ const replay = {
EventBus.$emit('uiMap.replay.done'); EventBus.$emit('uiMap.replay.done');
} }
}); });
}else{
//距离为0时,单独处理
const item = replay.data[ replay.data.length-1];
AMap.invoke('clearOverlays');
replay.Marker = mapService.createCarMarker(p2, AMap);
let infowindow= mapService.createInfoWindow(replay.Marker,AMap,replay.getNavgInfoContent(item))
AMap.invoke('addOverlay', replay.Marker )
AMap.invoke("mapOpenInfoWindow", infowindow,p2)
EventBus.$emit('uiMap.replay.initDone')
EventBus.$emit('uiMap.replay.done');
}
}, },
getDistance (p1, p2) { getDistance (p1, p2) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!