Calculate pixelRatio before using it

This fixes a regression introduced by https://github.com/openlayers/ol3/commit/646dd18 where the device pixel ratio was used to determine the tile size even though serverType was not defined for the source.
This commit is contained in:
Éric Lemoine
2014-01-30 09:50:34 +01:00
parent 61ed9a106c
commit 65dea74427

View File

@@ -330,6 +330,10 @@ ol.source.TileWMS.prototype.tileUrlFunction_ =
return undefined;
}
if (pixelRatio != 1 && (!this.hidpi_ || !goog.isDef(this.serverType_))) {
pixelRatio = 1;
}
var tileResolution = tileGrid.getResolution(tileCoord.z);
var tileExtent = tileGrid.getTileCoordExtent(
tileCoord, this.tmpExtent_);
@@ -354,9 +358,6 @@ ol.source.TileWMS.prototype.tileUrlFunction_ =
};
goog.object.extend(baseParams, this.params_);
if (pixelRatio != 1 && (!this.hidpi_ || !goog.isDef(this.serverType_))) {
pixelRatio = 1;
}
this.pixelRatio_ = pixelRatio;
return this.getRequestUrl_(tileCoord, tileSize, tileExtent,