Fix private scope issues in source/UrlTile and subclasses
This commit is contained in:
@@ -76,7 +76,6 @@ class TileArcGISRest extends TileImage {
|
||||
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
|
||||
tileGrid: options.tileGrid,
|
||||
tileLoadFunction: options.tileLoadFunction,
|
||||
tileUrlFunction: tileUrlFunction,
|
||||
url: options.url,
|
||||
urls: options.urls,
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : true,
|
||||
@@ -193,52 +192,52 @@ class TileArcGISRest extends TileImage {
|
||||
assign(this.params_, params);
|
||||
this.setKey(this.getKeyForParams_());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../tilecoord.js").TileCoord} tileCoord The tile coordinate
|
||||
* @param {number} pixelRatio The pixel ratio
|
||||
* @param {import("../proj/Projection.js").default} projection The projection
|
||||
* @return {string|undefined} The tile URL
|
||||
* @this {TileArcGISRest}
|
||||
*/
|
||||
function tileUrlFunction(tileCoord, pixelRatio, projection) {
|
||||
let tileGrid = this.getTileGrid();
|
||||
if (!tileGrid) {
|
||||
tileGrid = this.getTileGridForProjection(projection);
|
||||
/**
|
||||
* @param {import("../tilecoord.js").TileCoord} tileCoord The tile coordinate
|
||||
* @param {number} pixelRatio The pixel ratio
|
||||
* @param {import("../proj/Projection.js").default} projection The projection
|
||||
* @return {string|undefined} The tile URL
|
||||
* @override
|
||||
*/
|
||||
tileUrlFunction(tileCoord, pixelRatio, projection) {
|
||||
let tileGrid = this.getTileGrid();
|
||||
if (!tileGrid) {
|
||||
tileGrid = this.getTileGridForProjection(projection);
|
||||
}
|
||||
|
||||
if (tileGrid.getResolutions().length <= tileCoord[0]) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (pixelRatio != 1 && !this.hidpi_) {
|
||||
pixelRatio = 1;
|
||||
}
|
||||
|
||||
const tileExtent = tileGrid.getTileCoordExtent(tileCoord, this.tmpExtent_);
|
||||
let tileSize = toSize(tileGrid.getTileSize(tileCoord[0]), this.tmpSize);
|
||||
|
||||
if (pixelRatio != 1) {
|
||||
tileSize = scaleSize(tileSize, pixelRatio, this.tmpSize);
|
||||
}
|
||||
|
||||
// Apply default params and override with user specified values.
|
||||
const baseParams = {
|
||||
'F': 'image',
|
||||
'FORMAT': 'PNG32',
|
||||
'TRANSPARENT': true,
|
||||
};
|
||||
assign(baseParams, this.params_);
|
||||
|
||||
return this.getRequestUrl_(
|
||||
tileCoord,
|
||||
tileSize,
|
||||
tileExtent,
|
||||
pixelRatio,
|
||||
projection,
|
||||
baseParams
|
||||
);
|
||||
}
|
||||
|
||||
if (tileGrid.getResolutions().length <= tileCoord[0]) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (pixelRatio != 1 && !this.hidpi_) {
|
||||
pixelRatio = 1;
|
||||
}
|
||||
|
||||
const tileExtent = tileGrid.getTileCoordExtent(tileCoord, this.tmpExtent_);
|
||||
let tileSize = toSize(tileGrid.getTileSize(tileCoord[0]), this.tmpSize);
|
||||
|
||||
if (pixelRatio != 1) {
|
||||
tileSize = scaleSize(tileSize, pixelRatio, this.tmpSize);
|
||||
}
|
||||
|
||||
// Apply default params and override with user specified values.
|
||||
const baseParams = {
|
||||
'F': 'image',
|
||||
'FORMAT': 'PNG32',
|
||||
'TRANSPARENT': true,
|
||||
};
|
||||
assign(baseParams, this.params_);
|
||||
|
||||
return this.getRequestUrl_(
|
||||
tileCoord,
|
||||
tileSize,
|
||||
tileExtent,
|
||||
pixelRatio,
|
||||
projection,
|
||||
baseParams
|
||||
);
|
||||
}
|
||||
|
||||
export default TileArcGISRest;
|
||||
|
||||
Reference in New Issue
Block a user