Created
March 6, 2012 10:39
-
-
Save Talleyran/1985624 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
var maxResolution = 156543.03390625, | |
resolutions = [], | |
scales = [] | |
units = 'm' | |
for( var i=0; i<20; i++){ | |
var res = maxResolution/Math.pow(2,i) | |
resolutions.push(res) | |
scales.push(OpenLayers.Util.getScaleFromResolution(res,units)) | |
} | |
console.log(resolutions,scales) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment