feath:修改大屏地图警报信息
This commit is contained in:
parent
a51ceacab0
commit
667edf5fde
@ -431,7 +431,7 @@ export default {
|
|||||||
this.addMapMarker(item.locaton, 'sxt2', { name: item.name, device: item.device })
|
this.addMapMarker(item.locaton, 'sxt2', { name: item.name, device: item.device })
|
||||||
});
|
});
|
||||||
marks2.forEach((item, index) => {
|
marks2.forEach((item, index) => {
|
||||||
this.addMapMarker2(item.locaton, 'jb', { name: item.name, device: item.device })
|
this.addMapMarker2(item.locaton, 'jb', { name: item.name, device: item.device,address: item.address})
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
@ -463,7 +463,7 @@ export default {
|
|||||||
});
|
});
|
||||||
this.map.add(marker);
|
this.map.add(marker);
|
||||||
marker.on("click", (e) => {
|
marker.on("click", (e) => {
|
||||||
this.showInfoWindow(sourceData[0], sourceData[1], {
|
this.showInfoWindow2(sourceData[0], sourceData[1], {
|
||||||
type: "#304156",
|
type: "#304156",
|
||||||
...info,
|
...info,
|
||||||
});
|
});
|
||||||
@ -487,6 +487,24 @@ export default {
|
|||||||
});
|
});
|
||||||
infoWindow.open(this.map, [lng, lat]);
|
infoWindow.open(this.map, [lng, lat]);
|
||||||
},
|
},
|
||||||
|
// 显示信息窗体
|
||||||
|
showInfoWindow2(lng, lat, sourceInfo) {
|
||||||
|
let content = `
|
||||||
|
<div style="padding: 6px;background-color: #cce0f1;">
|
||||||
|
<div>
|
||||||
|
<div style="padding: 4px;margin:5px 0;color:red;"><b>${sourceInfo.address}</b></div>
|
||||||
|
<div style="padding: 4px;fontweigth:500"><b>${sourceInfo.device}</b></div>
|
||||||
|
<div style="padding: 4px;"><b>${sourceInfo.name}</b></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
const infoWindow = new AMap.InfoWindow({
|
||||||
|
content,
|
||||||
|
anchor: "middle-left",
|
||||||
|
isCustom: true,
|
||||||
|
});
|
||||||
|
infoWindow.open(this.map, [lng, lat]);
|
||||||
|
},
|
||||||
initChart1() {
|
initChart1() {
|
||||||
initChartStatic(
|
initChartStatic(
|
||||||
"chart1",
|
"chart1",
|
||||||
|
Loading…
Reference in New Issue
Block a user