mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-31 00:24:22 +02:00
Update the build
This commit is contained in:
Vendored
+36
@@ -322,6 +322,19 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
return layers;
|
return layers;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//Overrides LayerGroup.getLayer, WARNING: Really bad performance
|
||||||
|
getLayer: function (id) {
|
||||||
|
var result = null;
|
||||||
|
|
||||||
|
this.eachLayer(function (l) {
|
||||||
|
if (L.stamp(l) === id) {
|
||||||
|
result = l;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
|
||||||
//Returns true if the given layer is in this MarkerClusterGroup
|
//Returns true if the given layer is in this MarkerClusterGroup
|
||||||
hasLayer: function (layer) {
|
hasLayer: function (layer) {
|
||||||
if (!layer) {
|
if (!layer) {
|
||||||
@@ -552,8 +565,22 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
delete marker.__parent;
|
delete marker.__parent;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_isOrIsParent: function (el, oel) {
|
||||||
|
while (oel) {
|
||||||
|
if (el === oel) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
oel = oel.parentNode;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
_propagateEvent: function (e) {
|
_propagateEvent: function (e) {
|
||||||
if (e.layer instanceof L.MarkerCluster) {
|
if (e.layer instanceof L.MarkerCluster) {
|
||||||
|
//Prevent multiple clustermouseover/off events if the icon is made up of stacked divs (Doesn't work in ie <= 8, no relatedTarget)
|
||||||
|
if (e.originalEvent && this._isOrIsParent(e.layer._icon, e.originalEvent.relatedTarget)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
e.type = 'cluster' + e.type;
|
e.type = 'cluster' + e.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -604,6 +631,11 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
} else if (this.options.zoomToBoundsOnClick) {
|
} else if (this.options.zoomToBoundsOnClick) {
|
||||||
e.layer.zoomToBounds();
|
e.layer.zoomToBounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Focus the map again for keyboard users.
|
||||||
|
if (e.originalEvent && e.originalEvent.keyCode === 13) {
|
||||||
|
map._container.focus();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_showCoverage: function (e) {
|
_showCoverage: function (e) {
|
||||||
@@ -1041,8 +1073,10 @@ L.MarkerCluster = L.Marker.extend({
|
|||||||
map = this._group._map,
|
map = this._group._map,
|
||||||
boundsZoom = map.getBoundsZoom(this._bounds),
|
boundsZoom = map.getBoundsZoom(this._bounds),
|
||||||
zoom = this._zoom + 1,
|
zoom = this._zoom + 1,
|
||||||
|
mapZoom = map.getZoom(),
|
||||||
i;
|
i;
|
||||||
|
|
||||||
|
//calculate how fare we need to zoom down to see all of the markers
|
||||||
while (childClusters.length > 0 && boundsZoom > zoom) {
|
while (childClusters.length > 0 && boundsZoom > zoom) {
|
||||||
zoom++;
|
zoom++;
|
||||||
var newClusters = [];
|
var newClusters = [];
|
||||||
@@ -1054,6 +1088,8 @@ L.MarkerCluster = L.Marker.extend({
|
|||||||
|
|
||||||
if (boundsZoom > zoom) {
|
if (boundsZoom > zoom) {
|
||||||
this._group._map.setView(this._latlng, zoom);
|
this._group._map.setView(this._latlng, zoom);
|
||||||
|
} else if (boundsZoom <= mapZoom) { //If fitBounds wouldn't zoom us down, zoom us down instead
|
||||||
|
this._group._map.setView(this._latlng, mapZoom + 1);
|
||||||
} else {
|
} else {
|
||||||
this._group._map.fitBounds(this._bounds);
|
this._group._map.fitBounds(this._bounds);
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user