|
|
@ -202,7 +202,7 @@ export class MarkerCluster { |
|
|
|
</div>`); |
|
|
|
window.infoWindow = this.infoWindow; |
|
|
|
this.infoWindow.open(map, currentPageData[0].lnglat); |
|
|
|
|
|
|
|
window.openInfoWindow = true; |
|
|
|
this.infoWindow.dom.querySelector(".info-close").onclick = () => |
|
|
|
this.infoWindow.close(); |
|
|
|
|
|
|
@ -237,11 +237,21 @@ export class MarkerCluster { |
|
|
|
let hasClick = false; |
|
|
|
|
|
|
|
const reset = () => { |
|
|
|
this.infoWindow?.close?.(); |
|
|
|
if (!window.openInfoWindow) { |
|
|
|
this.infoWindow?.close?.(); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
map.on("zoomstart", reset); |
|
|
|
map.on("mapmove", reset); |
|
|
|
map.on("moveend", async () => { |
|
|
|
if (window.openInfoWindow) { |
|
|
|
console.log("窗口位移结束"); |
|
|
|
window.openInfoWindow = false; |
|
|
|
await new Promise((resolve) => setTimeout(resolve, 340)); |
|
|
|
window.infoWindow?.open?.(); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
const markerCluster = new AMap.MarkerCluster(map, [], { |
|
|
|
// gridSize: 15,
|
|
|
|