-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Description
Create a layer, bind a popup to it. Click the layer to open the popup. Now click someplace else on the map.
The popup will close, but map._popup will remain set. This means its impossible for other code to detect if a popup is still open. This is helpful - for example when trying to decide whether to show a label on map (see Leaflet/Leaflet.label#30)
The problem is that L.Popup._close is not correctly going through the map api.
_close: function () {
if (this._map) {
this._map.removeLayer(this);
}
},
This method should be:
_close: function () {
if (this._map) {
this._map.closePopup(this);
}
},
Thanks - Charlie