Update the build

This commit is contained in:
danzel
2012-08-02 10:16:22 +12:00
parent 755180b753
commit a0d3ad92cf
2 changed files with 19 additions and 1 deletions

View File

@@ -70,6 +70,22 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
return this;
},
clearLayers: function () {
//Need our own special implementation as the LayerGroup one doesn't work for us
//Remove all the visible layers
for (var i in this._layers) {
if (this._layers.hasOwnProperty(i)) {
L.FeatureGroup.prototype.removeLayer.call(this, this._layers[i]);
}
}
//Reset _topClusterLevel
this._generateInitialClusters();
return this;
},
//Overrides FeatureGroup.onAdd
onAdd: function (map) {
L.FeatureGroup.prototype.onAdd.call(this, map);
@@ -77,6 +93,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
if (!this._topClusterLevel) {
this._generateInitialClusters();
}
this._map.on('zoomend', this._zoomEnd, this);
this._map.on('moveend', this._moveEnd, this);
@@ -206,6 +223,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
currentZoom = this._map.getZoom();
this._topClusterLevel = this._clusterToMarkerCluster(this._needsClustering, maxZoom);
this._needsClustering = [];
//Generate to the top
while (minZoom < this._topClusterLevel._zoom) {

File diff suppressed because one or more lines are too long