Commit 59af78cf authored by 纪泽龙's avatar 纪泽龙

飞过去显示infowindow

parent eb4de9ef
...@@ -134,7 +134,7 @@ export default { ...@@ -134,7 +134,7 @@ export default {
this.obj.polyline.getExtData().class.view.$router.push({ this.obj.polyline.getExtData().class.view.$router.push({
path: "/realtimeData/realtimedetail", path: "/realtimeData/realtimedetail",
query: { query: {
alarmId: this.obj.polyline.getExtData().lineData.pipeId, deviceId: this.obj.polyline.getExtData().lineData.pipeId,
}, },
}); });
}, },
......
...@@ -227,18 +227,22 @@ class gaodeMap { ...@@ -227,18 +227,22 @@ class gaodeMap {
// // console.log(Card) // // console.log(Card)
// // e.target.content = this.getMarketContent(data); // // e.target.content = this.getMarketContent(data);
// }); // });
marker.on("mouseover", e => { // marker.on("mouseover", e => {
that.markerType = markerType; // that.markerType = markerType;
e.target.content = this.getMarketContent(data); // e.target.content = this.getMarketContent(data);
infoWindow.setContent(e.target.content); // infoWindow.setContent(e.target.content);
infoWindow.open(map, e.target.getPosition()); // infoWindow.open(map, e.target.getPosition());
that.boxCollision(infoWindow.dom); // that.boxCollision(infoWindow.dom);
// that.addCloneDome(e.target, infoWindow); // // that.addCloneDome(e.target, infoWindow);
// infoWindow.close(); // // infoWindow.close();
that.workerManInfoWindow = infoWindow; // that.workerManInfoWindow = infoWindow;
}); // });
marker.markerType=markerType;
marker.data = data;
marker.infoWindow =infoWindow;
marker.on("mouseover", this.wokerManOpen);
marker.on("mousedown", e => { marker.on("mousedown", e => {
console.log(data); // console.log(data);
that.closeInfoWindow(); that.closeInfoWindow();
if (marker.workerPoint) return; if (marker.workerPoint) return;
that.workerManView({ that.workerManView({
...@@ -342,7 +346,18 @@ class gaodeMap { ...@@ -342,7 +346,18 @@ class gaodeMap {
return marker; 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());
this.boxCollision(e.target.infoWindow.dom);
// that.addCloneDome(e.target, infoWindow);
// infoWindow.close();
this.workerManInfoWindow = e.target.infoWindow;
}
// 鼠标移入设备时候实行的函数
infoOpen = e => { infoOpen = e => {
if (e.target.getExtData().alarmState == 1) { if (e.target.getExtData().alarmState == 1) {
if (e.target.getExtData().deviceType == 4) { if (e.target.getExtData().deviceType == 4) {
...@@ -350,7 +365,7 @@ class gaodeMap { ...@@ -350,7 +365,7 @@ class gaodeMap {
} else if (e.target.getExtData().deviceType <= 3) { } else if (e.target.getExtData().deviceType <= 3) {
this.markerType = +e.target.getExtData().deviceType + 1 + ""; this.markerType = +e.target.getExtData().deviceType + 1 + "";
} }
console.log("that.markerType", this.markerType); // console.log("this.markerType", this.markerType);
// 警告状态这样就要换infowindow // 警告状态这样就要换infowindow
e.target.content = this.getMarketContent( e.target.content = this.getMarketContent(
e.target.getExtData(), e.target.getExtData(),
......
...@@ -724,13 +724,14 @@ export default { ...@@ -724,13 +724,14 @@ export default {
this.polylineInfoWindowShow(iten, lat, lng); this.polylineInfoWindowShow(iten, lat, lng);
} else if (item.value == 9) { } else if (item.value == 9) {
// 工作人员 // 工作人员
this.workerManInfoWindowShow(iten, lat, lng);
} else { } else {
// 其他设备 // 其他设备
this.diveceInfoWindowShow(iten, lat, lng); this.diveceInfoWindowShow(iten, lat, lng);
} }
}, },
// 如果是线条出现infowindow // 如果是线条飞过去出现infowindow
polylineInfoWindowShow(iten, lat, lng) { polylineInfoWindowShow(iten, lat, lng) {
const target = this.gaoMap.polyLines.filter((item) => { const target = this.gaoMap.polyLines.filter((item) => {
return item.getExtData().lineData.pipeId == iten.deviceId; return item.getExtData().lineData.pipeId == iten.deviceId;
...@@ -770,6 +771,30 @@ export default { ...@@ -770,6 +771,30 @@ export default {
this.gaoMap.infoOpen(e); this.gaoMap.infoOpen(e);
}; };
}, },
// workerMan,值班人员飞过去后侠士infowindow
workerManInfoWindowShow(iten, lat, lng) {
// console.log("iten",iten.userId)
const target = this.gaoMap.markers.filter((item) => {
return item.getExtData().userId == iten.userId;
})[0];
console.log("target", target);
const e = {
target,
lnglat: iten.path,
};
// 如果是原地不动,就直接执行
if (iten.path[0] == lng && iten.path[1] == lat) {
this.gaoMap.wokerManOpen(e);
return;
}
// 因为地图移动的时候infowindow无法显示
this.gaoMap.handleInfoWindowOpenFunc = () => {
this.gaoMap.wokerManOpen(e);
};
},
// 向右的箭头的动画
arrowRightChange(item) { arrowRightChange(item) {
const index = this.arrowRightNum.indexOf(item.value); const index = this.arrowRightNum.indexOf(item.value);
if (index >= 0) { if (index >= 0) {
...@@ -864,6 +889,7 @@ export default { ...@@ -864,6 +889,7 @@ export default {
this.allList[3] = lljArr; this.allList[3] = lljArr;
this.allList[4] = ylbArr; this.allList[4] = ylbArr;
}, },
// 值班人员
workerManClassify(workManData) { workerManClassify(workManData) {
const workManArr = workManData.map((item, index) => { const workManArr = workManData.map((item, index) => {
return { return {
......
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