diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js index e5c69034..ff81bccc 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js @@ -202,7 +202,7 @@ export class MarkerCluster { `); 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, diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Thumbnail/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Thumbnail/index.vue index 978a89a2..b91a768d 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Thumbnail/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Thumbnail/index.vue @@ -13,7 +13,7 @@ import { actualLocationList, canvasList } from "./data.js"; const mouseenterDebounceFunc = debounce(({ node }) => { if (["custom-html"].indexOf(node.shape) >= 0) { node.setZIndex(100); - console.log(node); + // console.log(node); } }, 0); const mouseleaveDebounceFunc = debounce(({ node }) => {