Refactor tile functions

* Add support for minZoom in XYZ tile grids and tile sources
* Factor out common tile coordinate transforms
This commit is contained in:
Tom Payne
2013-04-29 17:15:33 +02:00
parent 2447f09128
commit 6976fd96e3
8 changed files with 133 additions and 131 deletions

View File

@@ -317,9 +317,9 @@ ol.renderer.Layer.prototype.manageTilePyramid = function(
}
var wantedTiles = frameState.wantedTiles[tileSourceKey];
var tileQueue = frameState.tileQueue;
var minZoom = tileGrid.getMinZoom();
var tile, tileRange, tileResolution, x, y, z;
// FIXME this should loop up to tileGrid's minZ when implemented
for (z = currentZ; z >= 0; --z) {
for (z = currentZ; z >= minZoom; --z) {
tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z);
tileResolution = tileGrid.getResolution(z);
for (x = tileRange.minX; x <= tileRange.maxX; ++x) {