Commit 496049e1 authored by 纪泽龙's avatar 纪泽龙

优化gis地图的抽屉进入的时机

parent 1ed1ce44
...@@ -51,6 +51,8 @@ class gaodeMap { ...@@ -51,6 +51,8 @@ class gaodeMap {
view = null; view = null;
handleInfoWindowOpenFunc = null; handleInfoWindowOpenFunc = null;
onceFlag = false;
//构造函数中设置中央点默认值 //构造函数中设置中央点默认值
constructor(center) { constructor(center) {
this.markers = []; this.markers = [];
...@@ -107,6 +109,16 @@ class gaodeMap { ...@@ -107,6 +109,16 @@ class gaodeMap {
this.handleInfoWindowOpenFunc(); this.handleInfoWindowOpenFunc();
this.handleInfoWindowOpenFunc = null; this.handleInfoWindowOpenFunc = null;
} }
// 刚进入页面的时候只调用一次,让左侧的抽屉在地图移动完之后显示
if (!this.onceFlag) {
this.onceFlag = true;
this.view.backFlag = false;
let options = this.myMap.getStatus();
options.scrollWheel = true;
this.myMap.setStatus(options);
}
}); });
this.districtBoundaries(); this.districtBoundaries();
} }
...@@ -237,9 +249,9 @@ class gaodeMap { ...@@ -237,9 +249,9 @@ class gaodeMap {
// // infoWindow.close(); // // infoWindow.close();
// that.workerManInfoWindow = infoWindow; // that.workerManInfoWindow = infoWindow;
// }); // });
marker.markerType=markerType; marker.markerType = markerType;
marker.data = data; marker.data = data;
marker.infoWindow =infoWindow; marker.infoWindow = infoWindow;
marker.on("mouseover", this.wokerManOpen); marker.on("mouseover", this.wokerManOpen);
marker.on("mousedown", e => { marker.on("mousedown", e => {
// console.log(data); // console.log(data);
...@@ -346,17 +358,17 @@ class gaodeMap { ...@@ -346,17 +358,17 @@ class gaodeMap {
return marker; return marker;
} }
wokerManOpen=(e)=> { wokerManOpen = e => {
this.markerType = e.target.markerType; this.markerType = e.target.markerType;
e.target.content = this.getMarketContent( e.target.data); e.target.content = this.getMarketContent(e.target.data);
e.target.infoWindow.setContent(e.target.content); e.target.infoWindow.setContent(e.target.content);
e.target.infoWindow.open(map, e.target.getPosition()); e.target.infoWindow.open(map, e.target.getPosition());
console.log("e.target.getPosition()",e.target.getExtData()) console.log("e.target.getPosition()", e.target.getExtData());
this.boxCollision(e.target.infoWindow.dom); this.boxCollision(e.target.infoWindow.dom);
// that.addCloneDome(e.target, infoWindow); // that.addCloneDome(e.target, infoWindow);
// infoWindow.close(); // infoWindow.close();
this.workerManInfoWindow = e.target.infoWindow; this.workerManInfoWindow = e.target.infoWindow;
} };
// 鼠标移入设备时候实行的函数 // 鼠标移入设备时候实行的函数
infoOpen = e => { infoOpen = e => {
......
...@@ -369,7 +369,7 @@ export default { ...@@ -369,7 +369,7 @@ export default {
// 右下角数据 跟值班人员 // 右下角数据 跟值班人员
this.rightBottomData(); this.rightBottomData();
this.backFlag = false; // this.backFlag = 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