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

## Statements: 84.62% (11 / 13) Branches: 100% (0 / 0) Functions: 75% (3 / 4) Lines: 84.62% (11 / 13)

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

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34

    1

    50
    50

    50

    50
    200

    200

    50
    50
    50
    50

     /*
     * Adds control-related methods to L.Map.
     */

    L.Map.include({
    	addControl: function (control) {
    		control.addTo(this);
    		return this;
    	},

    	removeControl: function (control) {
    		control.removeFrom(this);
    		return this;
    	},

    	_initControlPos: function () {
    		var corners = this._controlCorners = {},
    		    l = 'leaflet-',
    		    container = this._controlContainer =
    		            L.DomUtil.create('div', l + 'control-container', this._container);

    		function createCorner(vSide, hSide) {
    			var className = l + vSide + ' ' + l + hSide;

    			corners[vSide + hSide] = L.DomUtil.create('div', className, container);
    		}

    		createCorner('top', 'left');
    		createCorner('top', 'right');
    		createCorner('bottom', 'left');
    		createCorner('bottom', 'right');
    	}
    });