1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 1 | /* * Adds popup-related methods to L.Map. */ L.Map.include({ openPopup: function (popup) { this.closePopup(); this._popup = popup; return this .addLayer(popup) .fire('popupopen', {popup: this._popup}); }, closePopup: function () { if (this._popup) { this._popup._close(); } return this; } }); |