Add tilePixelRatio option to ol.source.Tile
This commit is contained in:
@@ -16,6 +16,7 @@ goog.require('ol.tilegrid.TileGrid');
|
|||||||
* extent: (ol.Extent|undefined),
|
* extent: (ol.Extent|undefined),
|
||||||
* logo: (string|undefined),
|
* logo: (string|undefined),
|
||||||
* opaque: (boolean|undefined),
|
* opaque: (boolean|undefined),
|
||||||
|
* tilePixelRatio: (number|undefined),
|
||||||
* projection: ol.proj.ProjectionLike,
|
* projection: ol.proj.ProjectionLike,
|
||||||
* tileGrid: (ol.tilegrid.TileGrid|undefined)}}
|
* tileGrid: (ol.tilegrid.TileGrid|undefined)}}
|
||||||
*/
|
*/
|
||||||
@@ -48,6 +49,13 @@ ol.source.Tile = function(options) {
|
|||||||
*/
|
*/
|
||||||
this.opaque_ = goog.isDef(options.opaque) ? options.opaque : false;
|
this.opaque_ = goog.isDef(options.opaque) ? options.opaque : false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
this.tilePixelRatio_ = goog.isDef(options.tilePixelRatio) ?
|
||||||
|
options.tilePixelRatio : 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {ol.tilegrid.TileGrid}
|
* @type {ol.tilegrid.TileGrid}
|
||||||
@@ -185,7 +193,7 @@ ol.source.Tile.prototype.getTileGridForProjection = function(projection) {
|
|||||||
ol.source.Tile.prototype.getTilePixelSize =
|
ol.source.Tile.prototype.getTilePixelSize =
|
||||||
function(z, pixelRatio, projection) {
|
function(z, pixelRatio, projection) {
|
||||||
var tileGrid = this.getTileGridForProjection(projection);
|
var tileGrid = this.getTileGridForProjection(projection);
|
||||||
return tileGrid.getTileSize(z);
|
return tileGrid.getTileSize(z) * this.tilePixelRatio_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user