Move useLowResolutionTiles from layer renderer to tile source

This commit is contained in:
Tom Payne
2013-02-21 16:47:10 +01:00
parent 47e799ced0
commit 4c9b70fa5c
5 changed files with 22 additions and 26 deletions

View File

@@ -121,6 +121,25 @@ ol.source.TileSource.prototype.getTileGrid = function() {
};
/**
* @param {number} z Z.
* @param {ol.Extent} extent Extent.
*/
ol.source.TileSource.prototype.useLowResolutionTiles = function(z, extent) {
var tileGrid = this.getTileGrid();
var tileRange, x, y, zKey;
// FIXME this should loop up to tileGrid's minZ when implemented
for (; z >= 0; --z) {
tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z);
for (x = tileRange.minX; x <= tileRange.maxX; ++x) {
for (y = tileRange.minY; y <= tileRange.maxY; ++y) {
this.useTile(new ol.TileCoord(z, x, y));
}
}
}
};
/**
* Marks a tile coord as being used, without triggering a load.
* @param {ol.TileCoord} tileCoord Tile coordinate.