this.map.on("click", aa + "单个点", () => {
let aa = [asd[0], asd[1]];
var popUps = document.getElementsByClassName(
"mapboxgl-popup-content"
);
var poptip =
document.getElementsByClassName("mapboxgl-popup-tip");
if (popUps[0]) {
popUps[0].remove();
}
if (poptip[0]) {
poptip[0].remove();
}
let result = this.options.find(
(v) => v.value == this.form.tcyw
);
//关闭弹框
this.countyPopupDiv = `<div id="trackPopUp" style="width: 250px;"><div>
<i class="el-icon-location-information"></i>
${result.label}
</div>
<div style="border-bottom: 1px solid #6c5d5d;width: 100%;margin-top: 8px;"></div>
<div style="display:flex;justify-content: flex-start; font-size: 12px;
line-height: 30px;
white-space: normal;">
<div>${result.label}名称 : </div>
<div>${zx.properties.NAME}</div>
</div>
<div style="display:flex;justify-content: flex-start; font-size: 12px;line-height: 30px; white-space: normal;">
<div>${result.label}编号 : </div>
<div>${
zx.properties.ROADCODE == undefined
? zx.properties.NAME_1 == undefined
? zx.properties.SMAREA
: zx.properties.NAME_1
: zx.properties.ROADCODE
}</div>
</div>
<div style="display:flex;justify-content: flex-start; font-size: 12px;line-height: 30px; white-space: normal;">
<div>${result.label}简称 : </div>
<div>${
zx.properties.ROADNAME == undefined
? zx.properties.JOINID == undefined
? zx.properties.SMPERIMETER
: zx.properties.JOINID
: zx.properties.ROADNAME
}</div>
</div>
<a id="getdeatilOne" href="#" style="font-size:15px;line-height:30px;white-space:normal;">点击详情</a>
</div>`;
$("#getdeatilOne").click(() => {
console.log("1233333");
// let id ="BM00145668"
// let routeUrl = this.$router.resolve({
// path: `
http://maintain.cccc-am.com/webui/dci.html#/businessView/business?bimid=${id}&btmid=BTMDBNfL1dZs9wNzmLe&router=%2FnewView%2Fjcsj%2Flx&title=%E8%B7%AF%E7%BA%BF`, // 这里的路径就可以正常的写,不需要添加_blank: true
// });
// window.open(routeUrl.href, "_blank");
});
let _this = this;
_this.countyPopup = new mapboxgl.Popup({ maxWidth: "540px" })
.setLngLat(aa)
.setHTML(_this.countyPopupDiv)
.addTo(map);
});
});