When removing a marker from a FeatureGroup, only remove the popup if it was put there by the FeatureGroup.

Refs danzel/Leaflet.markercluster#24
This commit is contained in:
danzel 2012-08-01 13:40:43 +12:00
parent 5f7f5b2437
commit 7c94559355

View File

@ -26,7 +26,11 @@ L.FeatureGroup = L.LayerGroup.extend({
L.LayerGroup.prototype.removeLayer.call(this, layer);
return this.invoke('unbindPopup');
if (this._popupContent) {
return this.invoke('unbindPopup');
} else {
return this;
}
},
bindPopup: function (content) {