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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user