Update build

This commit is contained in:
danzel
2012-11-22 17:05:54 +13:00
parent f875421fc4
commit 290df23822
2 changed files with 27 additions and 1 deletions
+26
View File
@@ -328,6 +328,8 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
this._map.off('zoomend', this._zoomEnd, this);
this._map.off('moveend', this._moveEnd, this);
this._unbindEvents();
//In case we are in a cluster animation
this._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');
@@ -336,6 +338,13 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
}
L.FeatureGroup.prototype.onRemove.call(this, map);
//Clean up all the layers we added to the map
for (var i in this._layers) {
if (this._layers.hasOwnProperty(i)) {
L.FeatureGroup.prototype.removeLayer.call(this, this._layers[i]);
}
}
},
@@ -492,6 +501,23 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
}
},
_unbindEvents: function () {
var spiderfyOnMaxZoom = this.options.spiderfyOnMaxZoom,
showCoverageOnHover = this.options.showCoverageOnHover,
zoomToBoundsOnClick = this.options.zoomToBoundsOnClick,
map = this._map;
if (spiderfyOnMaxZoom || zoomToBoundsOnClick) {
this.off('clusterclick', null, this);
}
if (showCoverageOnHover) {
this.off('clustermouseover', null, this);
this.off('clustermouseout', null, this);
map.off('zoomend', null, this);
map.off('layerremove', null, this);
}
},
_zoomEnd: function () {
if (!this._map) { //May have been removed from the map by a zoomEnd handler
return;
+1 -1
View File
File diff suppressed because one or more lines are too long