leaflet同时打开多个pop
//{autoClose:false,closeOnClick: false}
let pointMark = L.marker([item.wd, item.jd], { icon: Icon }).addTo(mymap)
.bindPopup('This is a popup!',{autoClose:false,closeOnClick: false})
.openPopup();
同时关闭多个pop
// 关闭气泡
closePopup() {
let that = this
let iterations = 0;
let interval = setInterval(foo, 100);
function foo() {
iterations++;
if(!$(".leaflet-popup-close-button")[0]){
clearInterval(interval)
return
}
$(".leaflet-popup-close-button")[0].click();
if (iterations >= that.popupLength){
that.closePopup()
clearInterval(interval)
}
}
},