Add pixelRatio to ol.source.Tile#getTile
This commit is contained in:
@@ -81,6 +81,7 @@ ol.renderer.dom.TileLayer.prototype.prepareFrame =
|
||||
return;
|
||||
}
|
||||
|
||||
var pixelRatio = frameState.pixelRatio;
|
||||
var view2DState = frameState.view2DState;
|
||||
var projection = view2DState.projection;
|
||||
|
||||
@@ -113,7 +114,7 @@ ol.renderer.dom.TileLayer.prototype.prepareFrame =
|
||||
|
||||
var getTileIfLoaded = this.createGetTileIfLoadedFunction(function(tile) {
|
||||
return !goog.isNull(tile) && tile.getState() == ol.TileState.LOADED;
|
||||
}, tileSource, projection);
|
||||
}, tileSource, pixelRatio, projection);
|
||||
var findLoadedTiles = goog.bind(tileSource.findLoadedTiles, tileSource,
|
||||
tilesToDrawByZ, getTileIfLoaded);
|
||||
|
||||
@@ -123,7 +124,7 @@ ol.renderer.dom.TileLayer.prototype.prepareFrame =
|
||||
for (x = tileRange.minX; x <= tileRange.maxX; ++x) {
|
||||
for (y = tileRange.minY; y <= tileRange.maxY; ++y) {
|
||||
|
||||
tile = tileSource.getTile(z, x, y, projection);
|
||||
tile = tileSource.getTile(z, x, y, pixelRatio, projection);
|
||||
tileState = tile.getState();
|
||||
if (tileState == ol.TileState.LOADED) {
|
||||
tilesToDrawByZ[z][tile.tileCoord.toString()] = tile;
|
||||
@@ -241,8 +242,8 @@ ol.renderer.dom.TileLayer.prototype.prepareFrame =
|
||||
}
|
||||
|
||||
this.updateUsedTiles(frameState.usedTiles, tileSource, z, tileRange);
|
||||
this.manageTilePyramid(frameState, tileSource, tileGrid, projection, extent,
|
||||
z, tileLayer.getPreload());
|
||||
this.manageTilePyramid(frameState, tileSource, tileGrid, pixelRatio,
|
||||
projection, extent, z, tileLayer.getPreload());
|
||||
this.scheduleExpireCache(frameState, tileSource);
|
||||
this.updateLogos(frameState, tileSource);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user