Move useLowResolutionTiles from layer renderer to tile source
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user