其他页面制作,overlay点击事件方式冒泡

This commit is contained in:
2023-07-06 16:04:19 +08:00
parent b6792af6bb
commit 9bf53f6eb7
14 changed files with 3285 additions and 4524 deletions

View File

@ -435,7 +435,8 @@ function initMap() {
element: document.createElement('div'), // 创建一个用于显示信息的div元素
positioning: 'bottom-center', // 设置覆盖层相对于锚点的位置
offset: [0, -10], // 设置偏移量以便覆盖层不会遮挡图标
stopEvent: false, // 允许地图事件继续传播(例如,缩放和拖动)
stopEvent: true, // 允许地图事件继续传播(例如,缩放和拖动)
});
//滚轮控制村级矢量
@ -447,6 +448,7 @@ function initMap() {
layers.setVisible(false);
}
});
map.on('singleclick', function (e) {
alterData = ref([]);
const pixel = map.getEventPixel(e.originalEvent);
@ -476,6 +478,9 @@ function initMap() {
);
}
});
map.forEachFeatureAtPixel(pixel, (feature) => {