Browse Source

fix 双击才能出发弹窗bug

wangqin
qingzhengli 11 months ago
parent
commit
aa57f41ee1
  1. 14
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js
  2. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Thumbnail/index.vue

14
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js

@ -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,

2
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 }) => {

Loading…
Cancel
Save