# Code coverage report for src/map/ext/Map.Popup.js

## Statements: 14.29% (1 / 7) Branches: 0% (0 / 2) Functions: 0% (0 / 2) Lines: 14.29% (1 / 7)

All files » src/map/ext/ » Map.Popup.js

    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;
    	}
    });