fixed false FeatureGroup layerremove, close #1847

This commit is contained in:
Vladimir Agafonkin 2013-07-11 12:57:00 +03:00
parent c4877fb86f
commit 889136fe84
2 changed files with 4 additions and 3 deletions

View File

@ -20,6 +20,7 @@ An in-progress version being developed on the `stable` branch.
* Fixed a bug where `TileLayer.Canvas` wasn't immediately redrawn when `redraw` is called (by [@tofferrosen](https://github.com/tofferrosen)). [#1797](https://github.com/Leaflet/Leaflet/issues/1797) [#1817](https://github.com/Leaflet/Leaflet/issues/1817)
* Fixed a bug where `GeoJSON` ignored non-feature geometries passed in an array. [#1840](https://github.com/Leaflet/Leaflet/issues/1840)
* Fixed a regression where `Marker` shadow didn't animate on zoom after using `setIcon`. [#1768](https://github.com/Leaflet/Leaflet/issues/1768)
* Fixed a bug where `FeatureGroup` still fired `layerremove` event on `removeLayer` even if the given layer wan't present in the group. [#1847](https://github.com/Leaflet/Leaflet/issues/1847)
## 0.6.2 (June 28, 2013)

View File

@ -27,9 +27,9 @@ L.FeatureGroup = L.LayerGroup.extend({
},
removeLayer: function (layer) {
if (layer in this._layers) {
layer = this._layers[layer];
}
var id = layer in this._layers ? layer : this.getLayerId(layer);
if (!this._layers[id]) { return this; }
layer.off(L.FeatureGroup.EVENTS, this._propagateEvent, this);