1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-14 06:11:16 +00:00

show cluster photos

This commit is contained in:
zhouwenxuan
2024-12-28 11:47:46 +08:00
committed by 杨国璇
parent 4d703eb910
commit 86d5d564da
21 changed files with 636 additions and 262 deletions

View File

@@ -130,6 +130,7 @@ var BMapLib = window.BMapLib = BMapLib || {};
this._isAverageCenter = opts['isAverageCenter'];
}
this._styles = opts["styles"] || [];
this._callback = opts["callback"] || function(){};
var that = this;
this._map.addEventListener("zoomend",function(){
@@ -443,6 +444,10 @@ var BMapLib = window.BMapLib = BMapLib || {};
return count;
};
MarkerClusterer.prototype.getCallback = function() {
return this._callback;
}
/**
* @ignore
* Cluster
@@ -575,8 +580,12 @@ var BMapLib = window.BMapLib = BMapLib || {};
var thatMap = this._map;
var thatBounds = this.getBounds();
this._clusterMarker.addEventListener("click", function(event){
thatMap.setViewport(thatBounds);
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);
}
});
};