|
|
|
@ -1,179 +1,184 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<div class="bmap" id="container" ref="container"></div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<div class="bmap" id="container" ref="container"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import MapLine from "../../../public/zhenhaiLine.json"
|
|
|
|
|
import MapPoint from "../../../public/zhenhaiPoint.json"
|
|
|
|
|
import styleJson from "../../../public/custom_map_config.json"
|
|
|
|
|
|
|
|
|
|
import MapLine from "../../../public/zhenhaiLine.json";
|
|
|
|
|
import MapPoint from "../../../public/zhenhaiPoint.json";
|
|
|
|
|
import styleJson from "../../../public/custom_map_config.json";
|
|
|
|
|
import { topMap } from "@/api/offLineMap";
|
|
|
|
|
export default {
|
|
|
|
|
name: 'zhenhaimap',
|
|
|
|
|
props: ['waringList'],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
dongtaiPoint: [121.604192, 29.977299],
|
|
|
|
|
WaringList: this.waringList,
|
|
|
|
|
villageList: [],
|
|
|
|
|
villageSumList: [],
|
|
|
|
|
flag: true,
|
|
|
|
|
companyList: [],
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.initMap()
|
|
|
|
|
})
|
|
|
|
|
name: "zhenhaimap",
|
|
|
|
|
props: ["waringList"],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
dongtaiPoint: [121.604192, 29.977299],
|
|
|
|
|
WaringList: this.waringList,
|
|
|
|
|
villageList: [],
|
|
|
|
|
villageSumList: [],
|
|
|
|
|
flag: true,
|
|
|
|
|
companyList: [],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.initMap();
|
|
|
|
|
});
|
|
|
|
|
topMap({ scoreType: "season" }).then((res) => {
|
|
|
|
|
this.companyList = res.data;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
goBack() {
|
|
|
|
|
this.initMap();
|
|
|
|
|
|
|
|
|
|
this.$emit("goBack");
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
goBack() {
|
|
|
|
|
this.initMap()
|
|
|
|
|
|
|
|
|
|
this.$emit('goBack')
|
|
|
|
|
initMap() {
|
|
|
|
|
var BMap = window.BMap;
|
|
|
|
|
// console.log(BMap, 'BMap');
|
|
|
|
|
var map = new BMap.Map("container", {
|
|
|
|
|
style: {
|
|
|
|
|
styleJson,
|
|
|
|
|
},
|
|
|
|
|
initMap() {
|
|
|
|
|
var BMap = window.BMap
|
|
|
|
|
// console.log(BMap, 'BMap');
|
|
|
|
|
var map = new BMap.Map('container', {
|
|
|
|
|
style: {
|
|
|
|
|
styleJson
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// console.log(this.WaringList, 'waringList');
|
|
|
|
|
let that = this
|
|
|
|
|
map.centerAndZoom(new BMap.Point(this.dongtaiPoint[0], this.dongtaiPoint[1]), 13);
|
|
|
|
|
map.setMinZoom(12)
|
|
|
|
|
map.setMaxZoom(19)
|
|
|
|
|
map.enableScrollWheelZoom(true);
|
|
|
|
|
// hjrequest({
|
|
|
|
|
// url: '/yc/dt/statistical/village',
|
|
|
|
|
// method: 'get',
|
|
|
|
|
// params: { areaCode: that.areaCode }
|
|
|
|
|
// }).then((res) => {
|
|
|
|
|
// that.villageSumList = res.data
|
|
|
|
|
// })
|
|
|
|
|
// console.log(MapLine, 'MapLine');
|
|
|
|
|
for (var i = 0, n = MapLine.features.length; i < n; i++) {
|
|
|
|
|
showBoundaryEx(MapLine.features[i]);
|
|
|
|
|
}
|
|
|
|
|
var label = new BMap.Label();
|
|
|
|
|
showPoint()
|
|
|
|
|
showPic()
|
|
|
|
|
|
|
|
|
|
function showBoundaryEx(city) {
|
|
|
|
|
var paths = []
|
|
|
|
|
var list = city.geometry.coordinates
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// console.log(list.length, 'list[0].length')
|
|
|
|
|
//console.log(list[1], 'list[1].length')
|
|
|
|
|
var polygon = {}
|
|
|
|
|
if (list.length > 1) {
|
|
|
|
|
for (let a = 0; a < list.length; a++) {
|
|
|
|
|
paths = []
|
|
|
|
|
for (let i = 0; i < list[a][0].length; i++) {
|
|
|
|
|
let lat = list[a][0][i][1],
|
|
|
|
|
lng = list[a][0][i][0];
|
|
|
|
|
paths.push(new BMap.Point(lng, lat));
|
|
|
|
|
}
|
|
|
|
|
polygon = new BMap.Polygon(paths, {
|
|
|
|
|
fillColor: '#3b4c44',
|
|
|
|
|
strokeColor: "#0f1423",
|
|
|
|
|
fillOpacity: 0.6,
|
|
|
|
|
strokeWeight: 1
|
|
|
|
|
}); //创建多边形
|
|
|
|
|
map.addOverlay(polygon); //增加多边形
|
|
|
|
|
}
|
|
|
|
|
// // console.log(list, 'length');
|
|
|
|
|
} else {
|
|
|
|
|
// console.log(list[0], ' list[0]');
|
|
|
|
|
for (let i = 0; i < list[0].length; i++) {
|
|
|
|
|
let lat = list[0][i][1],
|
|
|
|
|
lng = list[0][i][0];
|
|
|
|
|
paths.push(new BMap.Point(lng, lat));
|
|
|
|
|
}
|
|
|
|
|
// console.log(list, 'length');
|
|
|
|
|
polygon = new BMap.Polygon(paths, {
|
|
|
|
|
fillColor: '#3b4c44',
|
|
|
|
|
strokeColor: "#0f1423",
|
|
|
|
|
fillOpacity: 0.6,
|
|
|
|
|
strokeWeight: 1
|
|
|
|
|
}); //创建多边形
|
|
|
|
|
map.addOverlay(polygon); //增加多边形
|
|
|
|
|
}
|
|
|
|
|
polygon.infowindow = new BMap.InfoWindow();
|
|
|
|
|
polygon.infowindow.name = city.properties.name;
|
|
|
|
|
polygon.addEventListener("mouseover", function () {
|
|
|
|
|
polygon.setFillColor("#ffa500");
|
|
|
|
|
});
|
|
|
|
|
polygon.addEventListener("mouseout", function () {
|
|
|
|
|
map.removeOverlay(label);
|
|
|
|
|
polygon.setFillColor('#3b4c44');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function showPoint() {
|
|
|
|
|
// console.log(MapPoint, 'MapPoint');
|
|
|
|
|
// console.log(this.WaringList, 'waringList');
|
|
|
|
|
let that = this;
|
|
|
|
|
map.centerAndZoom(
|
|
|
|
|
new BMap.Point(this.dongtaiPoint[0], this.dongtaiPoint[1]),
|
|
|
|
|
13
|
|
|
|
|
);
|
|
|
|
|
map.setMinZoom(12);
|
|
|
|
|
map.setMaxZoom(19);
|
|
|
|
|
map.enableScrollWheelZoom(true);
|
|
|
|
|
// hjrequest({
|
|
|
|
|
// url: '/yc/dt/statistical/village',
|
|
|
|
|
// method: 'get',
|
|
|
|
|
// params: { areaCode: that.areaCode }
|
|
|
|
|
// }).then((res) => {
|
|
|
|
|
// that.villageSumList = res.data
|
|
|
|
|
// })
|
|
|
|
|
// console.log(MapLine, 'MapLine');
|
|
|
|
|
for (var i = 0, n = MapLine.features.length; i < n; i++) {
|
|
|
|
|
showBoundaryEx(MapLine.features[i]);
|
|
|
|
|
}
|
|
|
|
|
var label = new BMap.Label();
|
|
|
|
|
showPoint();
|
|
|
|
|
showPic();
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < MapPoint.features.length; i++) {
|
|
|
|
|
var opts = {
|
|
|
|
|
position: new BMap.Point(MapPoint.features[i].geometry.coordinates[0], MapPoint.features[i].geometry.coordinates[1]), // 指定文本标注所在的地理位置
|
|
|
|
|
offset: new BMap.Size(-30, -30) // 设置文本偏移量
|
|
|
|
|
};
|
|
|
|
|
function showBoundaryEx(city) {
|
|
|
|
|
var paths = [];
|
|
|
|
|
var list = city.geometry.coordinates;
|
|
|
|
|
|
|
|
|
|
// 创建文本标注对象
|
|
|
|
|
var label1 = new BMap.Label(MapPoint.features[i].properties.name, opts);
|
|
|
|
|
// 自定义文本标注样式
|
|
|
|
|
label1.setStyle({
|
|
|
|
|
color: 'orange',
|
|
|
|
|
borderRadius: '5px',
|
|
|
|
|
borderColor: '#ccc',
|
|
|
|
|
padding: '10px',
|
|
|
|
|
fontSize: '16px',
|
|
|
|
|
height: '20px',
|
|
|
|
|
lineHeight: '20px',
|
|
|
|
|
backgroundColor: 'rgba(0,0,0,0)',
|
|
|
|
|
border: '0',
|
|
|
|
|
fontFamily: '微软雅黑'
|
|
|
|
|
});
|
|
|
|
|
map.addOverlay(label1);
|
|
|
|
|
}
|
|
|
|
|
// console.log(list.length, 'list[0].length')
|
|
|
|
|
//console.log(list[1], 'list[1].length')
|
|
|
|
|
var polygon = {};
|
|
|
|
|
if (list.length > 1) {
|
|
|
|
|
for (let a = 0; a < list.length; a++) {
|
|
|
|
|
paths = [];
|
|
|
|
|
for (let i = 0; i < list[a][0].length; i++) {
|
|
|
|
|
let lat = list[a][0][i][1],
|
|
|
|
|
lng = list[a][0][i][0];
|
|
|
|
|
paths.push(new BMap.Point(lng, lat));
|
|
|
|
|
}
|
|
|
|
|
function showPic() {
|
|
|
|
|
// console.log(that.WaringList, 'that.WaringList');
|
|
|
|
|
|
|
|
|
|
that.WaringList.forEach(item => {
|
|
|
|
|
// 创建小车图标
|
|
|
|
|
var myIcon = new BMap.Icon("public/dongtai/awrni.png", new BMap.Size(80, 80));
|
|
|
|
|
myIcon.setImageUrl("/dongtai/awrni.png")
|
|
|
|
|
// 创建Marker标注,使用小车图标
|
|
|
|
|
var marker = new BMap.Marker(new BMap.Point(item.longitude, item.latitude), {
|
|
|
|
|
icon: myIcon
|
|
|
|
|
});
|
|
|
|
|
// console.log(marker, 'marker');
|
|
|
|
|
map.addOverlay(marker);
|
|
|
|
|
marker.addEventListener("click", function () {
|
|
|
|
|
|
|
|
|
|
var label = new BMap.Label();
|
|
|
|
|
label.setStyle({
|
|
|
|
|
color: 'blue',
|
|
|
|
|
borderRadius: '5px',
|
|
|
|
|
borderColor: '#ccc',
|
|
|
|
|
padding: '10px',
|
|
|
|
|
fontSize: '16px',
|
|
|
|
|
fontFamily: '微软雅黑',
|
|
|
|
|
transform: 'translateX(-50%) translateY(calc(-100% - 10px))'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
label.setPosition(new BMap.Point(item.longitude, item.latitude));
|
|
|
|
|
label.setOffset(new BMap.Size(130, -10))
|
|
|
|
|
label.setStyle({ width: '340px', height: '238px', background: 'url(pbImg/气泡弹窗1.png) no-repeat', backgroundSize: '100% 100%', border: '0', color: '#fff', zIndex: 2000000000, })
|
|
|
|
|
label.setContent(`
|
|
|
|
|
polygon = new BMap.Polygon(paths, {
|
|
|
|
|
fillColor: "#3b4c44",
|
|
|
|
|
strokeColor: "#0f1423",
|
|
|
|
|
fillOpacity: 0.6,
|
|
|
|
|
strokeWeight: 1,
|
|
|
|
|
}); //创建多边形
|
|
|
|
|
map.addOverlay(polygon); //增加多边形
|
|
|
|
|
}
|
|
|
|
|
// // console.log(list, 'length');
|
|
|
|
|
} else {
|
|
|
|
|
// console.log(list[0], ' list[0]');
|
|
|
|
|
for (let i = 0; i < list[0].length; i++) {
|
|
|
|
|
let lat = list[0][i][1],
|
|
|
|
|
lng = list[0][i][0];
|
|
|
|
|
paths.push(new BMap.Point(lng, lat));
|
|
|
|
|
}
|
|
|
|
|
// console.log(list, 'length');
|
|
|
|
|
polygon = new BMap.Polygon(paths, {
|
|
|
|
|
fillColor: "#3b4c44",
|
|
|
|
|
strokeColor: "#0f1423",
|
|
|
|
|
fillOpacity: 0.6,
|
|
|
|
|
strokeWeight: 1,
|
|
|
|
|
}); //创建多边形
|
|
|
|
|
map.addOverlay(polygon); //增加多边形
|
|
|
|
|
}
|
|
|
|
|
polygon.infowindow = new BMap.InfoWindow();
|
|
|
|
|
polygon.infowindow.name = city.properties.name;
|
|
|
|
|
polygon.addEventListener("mouseover", function () {
|
|
|
|
|
polygon.setFillColor("#ffa500");
|
|
|
|
|
});
|
|
|
|
|
polygon.addEventListener("mouseout", function () {
|
|
|
|
|
map.removeOverlay(label);
|
|
|
|
|
polygon.setFillColor("#3b4c44");
|
|
|
|
|
});
|
|
|
|
|
// 点击多边形展示公司点位_1
|
|
|
|
|
polygon.addEventListener("click", function () {
|
|
|
|
|
if (city.properties.name == "骆驼街道") {
|
|
|
|
|
map.centerAndZoom(new BMap.Point(121.58887, 29.986122), 15);
|
|
|
|
|
} else if (city.properties.name == "招宝山街道") {
|
|
|
|
|
map.centerAndZoom(new BMap.Point(121.713707, 29.95656), 15);
|
|
|
|
|
} else if (city.properties.name == "蛟川街道") {
|
|
|
|
|
map.centerAndZoom(new BMap.Point(121.686105, 29.947339), 15);
|
|
|
|
|
} else if (city.properties.name == "庄市街道") {
|
|
|
|
|
map.centerAndZoom(new BMap.Point(121.627037, 29.925579), 15);
|
|
|
|
|
} else if (city.properties.name == "贵驷街道") {
|
|
|
|
|
map.centerAndZoom(new BMap.Point(121.624142, 29.985606), 15);
|
|
|
|
|
} else if (city.properties.name == "澥浦镇") {
|
|
|
|
|
map.centerAndZoom(new BMap.Point(121.607133, 30.037162), 15);
|
|
|
|
|
} else if (city.properties.name == "九龙湖镇") {
|
|
|
|
|
map.centerAndZoom(new BMap.Point(121.558532, 30.039457), 15);
|
|
|
|
|
}
|
|
|
|
|
// 点击多边形展示公司点位_2
|
|
|
|
|
that.companyList.forEach((item) => {
|
|
|
|
|
var point = new BMap.Point(item.longitude, item.latitude);
|
|
|
|
|
var marker = new BMap.Marker(point); // 创建标注
|
|
|
|
|
map.addOverlay(marker);
|
|
|
|
|
var content = item.companyName;
|
|
|
|
|
var label = new BMap.Label(content, {
|
|
|
|
|
// 创建文本标注
|
|
|
|
|
position: point, // 设置标注的地理位置
|
|
|
|
|
offset: new BMap.Size(-10, -50), // 设置标注的偏移量
|
|
|
|
|
});
|
|
|
|
|
label.setStyle({
|
|
|
|
|
backgroundColor: " rgba(0, 0, 0, 0)",
|
|
|
|
|
border: "0",
|
|
|
|
|
color: "#0060ce",
|
|
|
|
|
fontSize: "16px",
|
|
|
|
|
});
|
|
|
|
|
map.addOverlay(label);
|
|
|
|
|
label.addEventListener("click", function () {
|
|
|
|
|
var label_ponit = new BMap.Label(); // 公司点位
|
|
|
|
|
label_ponit.setStyle({
|
|
|
|
|
color: "blue",
|
|
|
|
|
borderRadius: "5px",
|
|
|
|
|
borderColor: "#ccc",
|
|
|
|
|
padding: "10px",
|
|
|
|
|
fontSize: "16px",
|
|
|
|
|
fontFamily: "微软雅黑",
|
|
|
|
|
transform: "translateX(-50%) translateY(calc(-100% - 10px))",
|
|
|
|
|
});
|
|
|
|
|
// 点位点击转处置弹窗
|
|
|
|
|
label_ponit.setPosition(
|
|
|
|
|
new BMap.Point(item.longitude, item.latitude)
|
|
|
|
|
);
|
|
|
|
|
label_ponit.setOffset(new BMap.Size(130, -10));
|
|
|
|
|
label_ponit.setStyle({
|
|
|
|
|
width: "340px",
|
|
|
|
|
height: "238px",
|
|
|
|
|
background: "url(pbImg/气泡弹窗1.png) no-repeat",
|
|
|
|
|
backgroundSize: "100% 100%",
|
|
|
|
|
border: "0",
|
|
|
|
|
color: "#fff",
|
|
|
|
|
zIndex: 2000000000,
|
|
|
|
|
});
|
|
|
|
|
label_ponit.setContent(`
|
|
|
|
|
<div style='width:100%;display:flex;justify-content: space-between;align-items: center;'> <h4 style='margin:12px;font-size: 14px;color: #FFE6D9;overflow: hidden;text-overflow: ellipsis;white-space: nowrap; '>${item.companyName}</h4><div class='closeBtn' style='background: url(pbImg/关闭.png) no-repeat;width:20px;height:20px;background-size: 100% 100%;margin-right:10px;"'></div></div>
|
|
|
|
|
<div style='margin:0 auto;font-size: 14px;width:316px;height:108px;padding:0 12px;background: rgba(108,128,151,0.20);border: 1px solid rgba(73,84,97,1);'>
|
|
|
|
|
<h4 style='height:33%;opacity: 0.8;margin:0;line-height:38px;font-weight:300;'><span style="color:#D0DEEE;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">一级指标:</span>${item.levelIndexOne}</h4>
|
|
|
|
@ -191,62 +196,165 @@ margin-left:80px;
|
|
|
|
|
font-weight: 400;'>转处置</div>
|
|
|
|
|
</div>
|
|
|
|
|
`);
|
|
|
|
|
map.addOverlay(label);
|
|
|
|
|
let btn = document.querySelector('.zhuanchuzhiBtn')
|
|
|
|
|
//console.log(btn, 'btn');
|
|
|
|
|
btn.addEventListener('click', () => {
|
|
|
|
|
//console.log(item, 'item');
|
|
|
|
|
that.$emit('zhuanchuzhi', item)
|
|
|
|
|
})
|
|
|
|
|
let closebtn = document.querySelector('.closeBtn')
|
|
|
|
|
//console.log(btn, 'btn');
|
|
|
|
|
closebtn.addEventListener('click', () => {
|
|
|
|
|
map.removeOverlay(label);
|
|
|
|
|
})
|
|
|
|
|
// label.addEventListener('mouseout', function () {
|
|
|
|
|
// map.removeOverlay(label);
|
|
|
|
|
// })
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
//that.flexPoint()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
flexPoint() {
|
|
|
|
|
var pointAll = document.querySelectorAll('.BMap_Marker.BMap_noprint')
|
|
|
|
|
console.log(pointAll, 'pointAll');
|
|
|
|
|
map.addOverlay(label_ponit);
|
|
|
|
|
let btn = document.querySelector(".zhuanchuzhiBtn");
|
|
|
|
|
//console.log(btn, 'btn');
|
|
|
|
|
btn.addEventListener("click", () => {
|
|
|
|
|
//console.log(item, 'item');
|
|
|
|
|
that.$emit("zhuanchuzhi", item);
|
|
|
|
|
});
|
|
|
|
|
let closebtn = document.querySelector(".closeBtn");
|
|
|
|
|
//console.log(btn, 'btn');
|
|
|
|
|
closebtn.addEventListener("click", () => {
|
|
|
|
|
map.removeOverlay(label_ponit);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
function showPoint() {
|
|
|
|
|
// console.log(MapPoint, 'MapPoint');
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < MapPoint.features.length; i++) {
|
|
|
|
|
var opts = {
|
|
|
|
|
position: new BMap.Point(
|
|
|
|
|
MapPoint.features[i].geometry.coordinates[0],
|
|
|
|
|
MapPoint.features[i].geometry.coordinates[1]
|
|
|
|
|
), // 指定文本标注所在的地理位置
|
|
|
|
|
offset: new BMap.Size(-30, -30), // 设置文本偏移量
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 创建文本标注对象
|
|
|
|
|
var label1 = new BMap.Label(
|
|
|
|
|
MapPoint.features[i].properties.name,
|
|
|
|
|
opts
|
|
|
|
|
);
|
|
|
|
|
// 自定义文本标注样式
|
|
|
|
|
label1.setStyle({
|
|
|
|
|
color: "orange",
|
|
|
|
|
borderRadius: "5px",
|
|
|
|
|
borderColor: "#ccc",
|
|
|
|
|
padding: "10px",
|
|
|
|
|
fontSize: "16px",
|
|
|
|
|
height: "20px",
|
|
|
|
|
lineHeight: "20px",
|
|
|
|
|
backgroundColor: "rgba(0,0,0,0)",
|
|
|
|
|
border: "0",
|
|
|
|
|
fontFamily: "微软雅黑",
|
|
|
|
|
});
|
|
|
|
|
map.addOverlay(label1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function showPic() {
|
|
|
|
|
// console.log(that.WaringList, 'that.WaringList');
|
|
|
|
|
that.WaringList.forEach((item) => {
|
|
|
|
|
// 创建小车图标
|
|
|
|
|
var myIcon = new BMap.Icon(
|
|
|
|
|
"public/dongtai/awrni.png",
|
|
|
|
|
new BMap.Size(80, 80)
|
|
|
|
|
);
|
|
|
|
|
myIcon.setImageUrl("/dongtai/awrni.png");
|
|
|
|
|
// 创建Marker标注,使用小车图标
|
|
|
|
|
var marker = new BMap.Marker(
|
|
|
|
|
new BMap.Point(item.longitude, item.latitude),
|
|
|
|
|
{
|
|
|
|
|
icon: myIcon,
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
console.log(marker, "marker");
|
|
|
|
|
map.addOverlay(marker);
|
|
|
|
|
marker.addEventListener("click", function () {
|
|
|
|
|
var label = new BMap.Label();
|
|
|
|
|
label.setStyle({
|
|
|
|
|
color: "blue",
|
|
|
|
|
borderRadius: "5px",
|
|
|
|
|
borderColor: "#ccc",
|
|
|
|
|
padding: "10px",
|
|
|
|
|
fontSize: "16px",
|
|
|
|
|
fontFamily: "微软雅黑",
|
|
|
|
|
transform: "translateX(-50%) translateY(calc(-100% - 10px))",
|
|
|
|
|
});
|
|
|
|
|
// 点位点击弹窗
|
|
|
|
|
label.setPosition(new BMap.Point(item.longitude, item.latitude));
|
|
|
|
|
label.setOffset(new BMap.Size(130, -10));
|
|
|
|
|
label.setStyle({
|
|
|
|
|
width: "340px",
|
|
|
|
|
height: "238px",
|
|
|
|
|
background: "url(pbImg/气泡弹窗1.png) no-repeat",
|
|
|
|
|
backgroundSize: "100% 100%",
|
|
|
|
|
border: "0",
|
|
|
|
|
color: "#fff",
|
|
|
|
|
zIndex: 2000000000,
|
|
|
|
|
});
|
|
|
|
|
label.setContent(`
|
|
|
|
|
<div style='width:100%;display:flex;justify-content: space-between;align-items: center;'> <h4 style='margin:12px;font-size: 14px;color: #FFE6D9;overflow: hidden;text-overflow: ellipsis;white-space: nowrap; '>${item.companyName}</h4><div class='closeBtn' style='background: url(pbImg/关闭.png) no-repeat;width:20px;height:20px;background-size: 100% 100%;margin-right:10px;"'></div></div>
|
|
|
|
|
<div style='margin:0 auto;font-size: 14px;width:316px;height:108px;padding:0 12px;background: rgba(108,128,151,0.20);border: 1px solid rgba(73,84,97,1);'>
|
|
|
|
|
<h4 style='height:33%;opacity: 0.8;margin:0;line-height:38px;font-weight:300;'><span style="color:#D0DEEE;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">一级指标:</span>${item.levelIndexOne}</h4>
|
|
|
|
|
<h4 style='height:33%;opacity: 0.8;margin:0;line-height:38px;font-weight:300;'><span style="color:#D0DEEE;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">预警指标:</span>"${item.levelIndexThree}"异常</h4>
|
|
|
|
|
<h4 style='height:33%;opacity: 0.8;margin:0;line-height:38px;font-weight:300;'><span style="color:#D0DEEE;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">预警时间:</span>${item.alarmTime}</h4>
|
|
|
|
|
<div class='zhuanchuzhiBtn' style='width:80px;height:34px;font-size: 14px;
|
|
|
|
|
color: #FFFFFF;
|
|
|
|
|
text-align:center;
|
|
|
|
|
line-height:34px;
|
|
|
|
|
background: url(pbImg/2121.png) no-repeat;
|
|
|
|
|
margin-top:20px;
|
|
|
|
|
background-size: 100% 100%;
|
|
|
|
|
letter-spacing: 0;
|
|
|
|
|
margin-left:80px;
|
|
|
|
|
font-weight: 400;'>转处置</div>
|
|
|
|
|
</div>
|
|
|
|
|
`);
|
|
|
|
|
map.addOverlay(label);
|
|
|
|
|
let btn = document.querySelector(".zhuanchuzhiBtn");
|
|
|
|
|
//console.log(btn, 'btn');
|
|
|
|
|
btn.addEventListener("click", () => {
|
|
|
|
|
//console.log(item, 'item');
|
|
|
|
|
that.$emit("zhuanchuzhi", item);
|
|
|
|
|
});
|
|
|
|
|
let closebtn = document.querySelector(".closeBtn");
|
|
|
|
|
//console.log(btn, 'btn');
|
|
|
|
|
closebtn.addEventListener("click", () => {
|
|
|
|
|
map.removeOverlay(label);
|
|
|
|
|
});
|
|
|
|
|
// label.addEventListener('mouseout', function () {
|
|
|
|
|
// map.removeOverlay(label);
|
|
|
|
|
// })
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
//that.flexPoint()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
flexPoint() {
|
|
|
|
|
var pointAll = document.querySelectorAll(".BMap_Marker.BMap_noprint");
|
|
|
|
|
console.log(pointAll, "pointAll");
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="less">
|
|
|
|
|
.bmap {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
border: 1px solid #000000;
|
|
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
border: 1px solid #000000;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/deep/ .BMap_Marker {
|
|
|
|
|
z-index: 1000;
|
|
|
|
|
background: url('../../../public/dongtai/awrni.png') no-repeat !important;
|
|
|
|
|
background-size: 100% 100% !important;
|
|
|
|
|
z-index: 1000;
|
|
|
|
|
background: url("../../../public/dongtai/awrni.png") no-repeat !important;
|
|
|
|
|
background-size: 100% 100% !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.fanhui {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
width: 50px;
|
|
|
|
|
height: 20px;
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 49%;
|
|
|
|
|
bottom: 30px;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
z-index: 50;
|
|
|
|
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
width: 50px;
|
|
|
|
|
height: 20px;
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 49%;
|
|
|
|
|
bottom: 30px;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
z-index: 50;
|
|
|
|
|
}
|
|
|
|
|
</style>
|