mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Update build.
This commit is contained in:
25
dist/leaflet.markercluster-src.js
vendored
25
dist/leaflet.markercluster-src.js
vendored
@@ -21,7 +21,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
zoomToBoundsOnClick: true,
|
||||
singleMarkerMode: false,
|
||||
|
||||
disableClusteringAtZoom: null
|
||||
disableClusteringAtZoom: null,
|
||||
|
||||
skipDuplicateAddTesting: false
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
@@ -40,8 +42,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
|
||||
addLayer: function (layer) {
|
||||
|
||||
if (layer instanceof L.LayerGroup)
|
||||
{
|
||||
if (layer instanceof L.LayerGroup) {
|
||||
for (var i in layer._layers) {
|
||||
if (layer._layers.hasOwnProperty(i)) {
|
||||
this.addLayer(layer._layers[i]);
|
||||
@@ -66,6 +67,10 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
return this;
|
||||
}
|
||||
|
||||
if (!this.options.skipDuplicateAddTesting && this.hasLayer(layer)) {
|
||||
return this;
|
||||
}
|
||||
|
||||
//If we have already clustered we'll need to add this one to a cluster
|
||||
|
||||
if (this._unspiderfy) {
|
||||
@@ -117,6 +122,20 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
return this;
|
||||
},
|
||||
|
||||
hasLayer: function (layer) {
|
||||
var res = false;
|
||||
|
||||
this._topClusterLevel._recursively(new L.LatLngBounds([layer.getLatLng()]), 0, this._map.getMaxZoom() + 1,
|
||||
function (cluster) {
|
||||
for (var i = cluster._markers.length - 1; i >= 0 && !res; i--) {
|
||||
if (cluster._markers[i] === layer) {
|
||||
res = true;
|
||||
}
|
||||
}
|
||||
}, null);
|
||||
return res;
|
||||
},
|
||||
|
||||
//Overrides FeatureGroup.onAdd
|
||||
onAdd: function (map) {
|
||||
L.FeatureGroup.prototype.onAdd.call(this, map);
|
||||
|
||||
2
dist/leaflet.markercluster.js
vendored
2
dist/leaflet.markercluster.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user