diff --git a/CHANGELOG.md b/CHANGELOG.md index 32a32bdec7..f84f44b4c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index ed8d2c68b4..028fc0cfa8 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -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; },