Avoid left shift in resolution calculations

This commit is contained in:
Tim Schaub
2013-02-18 18:37:27 -07:00
parent 4c2463dd91
commit 0a5dae9ed0
4 changed files with 36 additions and 4 deletions

View File

@@ -333,8 +333,9 @@ ol.tilegrid.createForProjection =
opt_tileSize : new ol.Size(ol.DEFAULT_TILE_SIZE, ol.DEFAULT_TILE_SIZE);
var resolutions = new Array(maxZoom + 1);
goog.asserts.assert(tileSize.width == tileSize.height);
size = size / tileSize.width;
for (var z = 0, zz = resolutions.length; z < zz; ++z) {
resolutions[z] = size / (tileSize.width << z);
resolutions[z] = size / Math.pow(2, z);
}
return new ol.tilegrid.TileGrid({
origin: projectionExtent.getTopLeft(),