Fix map.removeLayers(MCG) not doing anything. Thanks Driklyn. Fixes #108

This commit is contained in:
danzel
2012-12-21 15:01:13 +13:00
parent d324fdc4b4
commit 46ca075ccb
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -19,6 +19,7 @@ Leaflet.markercluster
* IE10 Bug fix (Reported by [@theLundquist](https://github.com/theLundquist)) [#86](https://github.com/danzel/Leaflet.markercluster/issues/86)
* Fixes for hasLayer after removing a layer (Reported by [@cvisto](https://github.com/cvisto)) [#44](https://github.com/danzel/Leaflet.markercluster/issues/44)
* Fix clearLayers not unsetting __parent of the markers, preventing them from being re-added. (Reported by [@apuntovanini](https://github.com/apuntovanini)) [#99](https://github.com/danzel/Leaflet.markercluster/issues/99)
* Fix map.removeLayer(markerClusterGroup) not working (Reported by [@Driklyn](https://github.com/Driklyn)) [#108](https://github.com/danzel/Leaflet.markercluster/issues/108)
## 0.2 (2012-10-11)
+2 -2
View File
@@ -351,14 +351,14 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
this._spiderfierOnRemove();
}
this._map = null;
//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]);
}
}
this._map = null;
},