Add pixelRatio to ol.source.Tile#getTile

This commit is contained in:
Tom Payne
2014-01-14 16:31:37 +01:00
parent 33f0024747
commit 58fef69fac
7 changed files with 32 additions and 26 deletions

View File

@@ -119,14 +119,15 @@ ol.source.TileImage.prototype.expireCache = function(usedTiles) {
/**
* @inheritDoc
*/
ol.source.TileImage.prototype.getTile = function(z, x, y, projection) {
ol.source.TileImage.prototype.getTile =
function(z, x, y, pixelRatio, projection) {
var tileCoordKey = this.getKeyZXY(z, x, y);
if (this.tileCache.containsKey(tileCoordKey)) {
return /** @type {!ol.Tile} */ (this.tileCache.get(tileCoordKey));
} else {
goog.asserts.assert(projection);
var tileCoord = new ol.TileCoord(z, x, y);
var tileUrl = this.tileUrlFunction(tileCoord, 1, projection);
var tileUrl = this.tileUrlFunction(tileCoord, pixelRatio, projection);
var tile = new this.tileClass(
tileCoord,
goog.isDef(tileUrl) ? ol.TileState.IDLE : ol.TileState.EMPTY,