1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-14 06:11:16 +00:00
This commit is contained in:
zhouwenxuan
2025-01-04 18:00:16 +08:00
committed by 杨国璇
parent 86d5d564da
commit 89b5100102
8 changed files with 89 additions and 157 deletions

View File

@@ -580,14 +580,29 @@ var BMapLib = window.BMapLib = BMapLib || {};
var thatMap = this._map;
var thatBounds = this.getBounds();
this._clusterMarker.addEventListener("click",(event) => {
// thatMap.setViewport(thatBounds);
if (this._markerClusterer && typeof this._markerClusterer.getCallback() === 'function') {
const markers = this._markers;
this._markerClusterer.getCallback()(event, markers);
let clickTimeout;
this._clusterMarker.addEventListener("click", (event) => {
if (clickTimeout) {
clearTimeout(clickTimeout);
clickTimeout = null;
return;
}
clickTimeout = setTimeout(() => {
if (this._markerClusterer && typeof this._markerClusterer.getCallback() === 'function') {
const markers = this._markers;
this._markerClusterer.getCallback()(event, markers);
}
clickTimeout = null;
}, 300); // Delay to differentiate between single and double click
});
this._clusterMarker.addEventListener("dblclick", (event) => {
if (clickTimeout) {
clearTimeout(clickTimeout);
clickTimeout = null;
}
// Do nothing on double click
});
};
/**