Add pixelRatio to ol.TileUrlFunction
This commit is contained in:
@@ -101,10 +101,11 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse =
|
||||
/**
|
||||
* @this {ol.source.BingMaps}
|
||||
* @param {ol.TileCoord} tileCoord Tile coordinate.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @return {string|undefined} Tile URL.
|
||||
*/
|
||||
function(tileCoord, projection) {
|
||||
function(tileCoord, pixelRatio, projection) {
|
||||
goog.asserts.assert(ol.proj.equivalent(
|
||||
projection, this.getProjection()));
|
||||
if (goog.isNull(tileCoord)) {
|
||||
|
||||
@@ -126,7 +126,7 @@ ol.source.TileImage.prototype.getTile = function(z, x, y, projection) {
|
||||
} else {
|
||||
goog.asserts.assert(projection);
|
||||
var tileCoord = new ol.TileCoord(z, x, y);
|
||||
var tileUrl = this.tileUrlFunction(tileCoord, projection);
|
||||
var tileUrl = this.tileUrlFunction(tileCoord, 1, projection);
|
||||
var tile = new this.tileClass(
|
||||
tileCoord,
|
||||
goog.isDef(tileUrl) ? ol.TileState.IDLE : ol.TileState.EMPTY,
|
||||
|
||||
@@ -132,11 +132,13 @@ ol.source.TileWMS.prototype.resetCoordKeyPrefix_ = function() {
|
||||
|
||||
/**
|
||||
* @param {ol.TileCoord} tileCoord Tile coordinate.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @private
|
||||
* @return {string|undefined} Tile URL.
|
||||
*/
|
||||
ol.source.TileWMS.prototype.tileUrlFunction_ = function(tileCoord, projection) {
|
||||
ol.source.TileWMS.prototype.tileUrlFunction_ =
|
||||
function(tileCoord, pixelRatio, projection) {
|
||||
|
||||
var urls = this.urls_;
|
||||
if (!goog.isDef(urls) || goog.array.isEmpty(urls)) {
|
||||
|
||||
@@ -96,10 +96,11 @@ ol.source.WMTS = function(options) {
|
||||
/**
|
||||
* @this {ol.source.WMTS}
|
||||
* @param {ol.TileCoord} tileCoord Tile coordinate.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @return {string|undefined} Tile URL.
|
||||
*/
|
||||
function(tileCoord, projection) {
|
||||
function(tileCoord, pixelRatio, projection) {
|
||||
if (goog.isNull(tileCoord)) {
|
||||
return undefined;
|
||||
} else {
|
||||
|
||||
@@ -61,10 +61,11 @@ ol.source.Zoomify = function(opt_options) {
|
||||
/**
|
||||
* @this {ol.source.TileImage}
|
||||
* @param {ol.TileCoord} tileCoord Tile Coordinate.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @return {string|undefined} Tile URL.
|
||||
*/
|
||||
function(tileCoord, projection) {
|
||||
function(tileCoord, pixelRatio, projection) {
|
||||
if (goog.isNull(tileCoord)) {
|
||||
return undefined;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user