Remove the tilePixelRatio option from ol.source.VectorTile
This commit is contained in:
@@ -141,7 +141,7 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse = function(response)
|
||||
extent: extent,
|
||||
minZoom: resource.zoomMin,
|
||||
maxZoom: maxZoom,
|
||||
tileSize: tileSize / this.getTilePixelRatio()
|
||||
tileSize: tileSize / (this.hidpi_ ? 2 : 1)
|
||||
});
|
||||
this.tileGrid = tileGrid;
|
||||
|
||||
|
||||
@@ -244,12 +244,11 @@ ol.source.Tile.prototype.getTileCacheForProjection = function(projection) {
|
||||
/**
|
||||
* Get the tile pixel ratio for this source. Subclasses may override this
|
||||
* method, which is meant to return a supported pixel ratio that matches the
|
||||
* provided `opt_pixelRatio` as close as possible. When no `opt_pixelRatio` is
|
||||
* provided, it is meant to return `this.tilePixelRatio_`.
|
||||
* @param {number=} opt_pixelRatio Pixel ratio.
|
||||
* provided `pixelRatio` as close as possible.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @return {number} Tile pixel ratio.
|
||||
*/
|
||||
ol.source.Tile.prototype.getTilePixelRatio = function(opt_pixelRatio) {
|
||||
ol.source.Tile.prototype.getTilePixelRatio = function(pixelRatio) {
|
||||
return this.tilePixelRatio_;
|
||||
};
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ ol.source.VectorTile = function(options) {
|
||||
tileLoadFunction: options.tileLoadFunction ?
|
||||
options.tileLoadFunction : ol.VectorImageTile.defaultLoadFunction,
|
||||
tileUrlFunction: options.tileUrlFunction,
|
||||
tilePixelRatio: options.tilePixelRatio,
|
||||
url: options.url,
|
||||
urls: options.urls,
|
||||
wrapX: options.wrapX === undefined ? true : options.wrapX
|
||||
@@ -141,10 +140,8 @@ ol.source.VectorTile.prototype.getTileGridForProjection = function(projection) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.source.VectorTile.prototype.getTilePixelRatio = function(opt_pixelRatio) {
|
||||
return opt_pixelRatio == undefined ?
|
||||
ol.source.UrlTile.prototype.getTilePixelRatio.call(this, opt_pixelRatio) :
|
||||
opt_pixelRatio;
|
||||
ol.source.VectorTile.prototype.getTilePixelRatio = function(pixelRatio) {
|
||||
return pixelRatio;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user