Created
September 27, 2016 07:27
-
-
Save IvanSanchez/7529e0516ec260d4efe8ce510fab1083 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint indent:[2, "tab", {"VariableDeclarator": 0}], no-mixed-spaces-and-tabs:[2, "smart-tabs"] */ | |
// Code snipped from https://github.com/Leaflet/Leaflet/blob/master/src/layer/Layer.js | |
L.Layer = L.Evented.extend({ | |
_updateZoomLevels: function () { | |
var minZoom = Infinity, | |
maxZoom = -Infinity, | |
oldZoomSpan = this._getZoomSpan(); | |
for (var i in this._zoomBoundLayers) { | |
var options = this._zoomBoundLayers[i].options; | |
minZoom = options.minZoom === undefined ? minZoom : Math.min(minZoom, options.minZoom); | |
maxZoom = options.maxZoom === undefined ? maxZoom : Math.max(maxZoom, options.maxZoom); | |
} | |
this._layersMaxZoom = maxZoom === -Infinity ? undefined : maxZoom; | |
this._layersMinZoom = minZoom === Infinity ? undefined : minZoom; | |
if (oldZoomSpan !== this._getZoomSpan()) { | |
this.fire('zoomlevelschange'); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment