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

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

parent 1ed1ce44
......@@ -51,6 +51,8 @@ class gaodeMap {
view = null;
handleInfoWindowOpenFunc = null;
onceFlag = false;
//构造函数中设置中央点默认值
constructor(center) {
this.markers = [];
......@@ -107,6 +109,16 @@ class gaodeMap {
this.handleInfoWindowOpenFunc();
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();
}
......@@ -237,9 +249,9 @@ class gaodeMap {
// // infoWindow.close();
// that.workerManInfoWindow = infoWindow;
// });
marker.markerType=markerType;
marker.markerType = markerType;
marker.data = data;
marker.infoWindow =infoWindow;
marker.infoWindow = infoWindow;
marker.on("mouseover", this.wokerManOpen);
marker.on("mousedown", e => {
// console.log(data);
......@@ -334,7 +346,7 @@ class gaodeMap {
map.setZoom("11");
}
//map.setFitView();
function infoClose(e) {
let options = map.getStatus();
options.scrollWheel = true;
......@@ -346,18 +358,18 @@ class gaodeMap {
return marker;
}
wokerManOpen=(e)=> {
this.markerType = e.target.markerType;
e.target.content = this.getMarketContent( e.target.data);
e.target.infoWindow.setContent(e.target.content);
e.target.infoWindow.open(map, e.target.getPosition());
console.log("e.target.getPosition()",e.target.getExtData())
this.boxCollision(e.target.infoWindow.dom);
// that.addCloneDome(e.target, infoWindow);
// infoWindow.close();
this.workerManInfoWindow = e.target.infoWindow;
}
wokerManOpen = e => {
this.markerType = e.target.markerType;
e.target.content = this.getMarketContent(e.target.data);
e.target.infoWindow.setContent(e.target.content);
e.target.infoWindow.open(map, e.target.getPosition());
console.log("e.target.getPosition()", e.target.getExtData());
this.boxCollision(e.target.infoWindow.dom);
// that.addCloneDome(e.target, infoWindow);
// infoWindow.close();
this.workerManInfoWindow = e.target.infoWindow;
};
// 鼠标移入设备时候实行的函数
infoOpen = e => {
if (e.target.getExtData().alarmState == 1) {
......
......@@ -369,7 +369,7 @@ export default {
// 右下角数据 跟值班人员
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