mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
made a minor change to _zoomOrSpiderfy to Spiderfy without zooming if everything in the cluster is at the same lat long. This prevents zooming into max level if there is no real reason to do so, since all points will be at the same location. This minor change increased usability in a personal project.
This commit is contained in:
@@ -655,7 +655,11 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
|
||||
_zoomOrSpiderfy: function (e) {
|
||||
var map = this._map;
|
||||
if (map.getMaxZoom() === map.getZoom()) {
|
||||
if (e.layer._bounds._northEast.equals(e.layer._bounds._southWest)){
|
||||
if (this.options.spiderfyOnMaxZoom) {
|
||||
e.layer.spiderfy();
|
||||
}
|
||||
}else if (map.getMaxZoom() === map.getZoom()) {
|
||||
if (this.options.spiderfyOnMaxZoom) {
|
||||
e.layer.spiderfy();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user