Make ol.source.Tile#getTilePixelRatio work for all sources
Even for sources which serve dynamic tile sizes based on devicePixelRatio
This commit is contained in:
@@ -275,19 +275,10 @@ ol.source.TileWMS.prototype.getRequestUrl_ =
|
||||
|
||||
|
||||
/**
|
||||
* @param {number} z Z.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @return {ol.Size} Size.
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.source.TileWMS.prototype.getTilePixelSize =
|
||||
function(z, pixelRatio, projection) {
|
||||
var tileSize = goog.base(this, 'getTilePixelSize', z, pixelRatio, projection);
|
||||
if (pixelRatio == 1 || !this.hidpi_ || this.serverType_ === undefined) {
|
||||
return tileSize;
|
||||
} else {
|
||||
return ol.size.scale(tileSize, pixelRatio, this.tmpSize);
|
||||
}
|
||||
ol.source.TileWMS.prototype.getTilePixelRatio = function(pixelRatio) {
|
||||
return (!this.hidpi_ || this.serverType_ === undefined) ? 1 : pixelRatio;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user