Shorter module paths for default exports
This commit is contained in:
+15
-13
@@ -29,7 +29,7 @@ import {getForProjection as getTileGridForProjection} from '../tilegrid.js';
|
||||
* @property {module:ol/source/State~State} [state] Source state.
|
||||
* @property {module:ol/ImageTile~TileClass} [tileClass] Class used to instantiate image tiles.
|
||||
* Default is {@link module:ol/ImageTile~ImageTile}.
|
||||
* @property {module:ol/tilegrid/TileGrid~TileGrid} [tileGrid] Tile grid.
|
||||
* @property {module:ol/tilegrid/TileGrid} [tileGrid] Tile grid.
|
||||
* @property {module:ol/Tile~LoadFunction} [tileLoadFunction] Optional function to load a tile given a URL. The default is
|
||||
* ```js
|
||||
* function(imageTile, src) {
|
||||
@@ -93,7 +93,7 @@ const TileImage = function(options) {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {function(new: module:ol/ImageTile~ImageTile, module:ol/tilecoord~TileCoord, module:ol/TileState, string,
|
||||
* @type {function(new: module:ol/ImageTile, module:ol/tilecoord~TileCoord, module:ol/TileState, string,
|
||||
* ?string, module:ol/Tile~LoadFunction, module:ol/Tile~Options=)}
|
||||
*/
|
||||
this.tileClass = options.tileClass !== undefined ?
|
||||
@@ -101,13 +101,13 @@ const TileImage = function(options) {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {!Object.<string, module:ol/TileCache~TileCache>}
|
||||
* @type {!Object.<string, module:ol/TileCache>}
|
||||
*/
|
||||
this.tileCacheForProjection = {};
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {!Object.<string, module:ol/tilegrid/TileGrid~TileGrid>}
|
||||
* @type {!Object.<string, module:ol/tilegrid/TileGrid>}
|
||||
*/
|
||||
this.tileGridForProjection = {};
|
||||
|
||||
@@ -215,7 +215,9 @@ TileImage.prototype.getTileGridForProjection = function(projection) {
|
||||
if (!(projKey in this.tileGridForProjection)) {
|
||||
this.tileGridForProjection[projKey] = getTileGridForProjection(projection);
|
||||
}
|
||||
return /** @type {!module:ol/tilegrid/TileGrid~TileGrid} */ (this.tileGridForProjection[projKey]);
|
||||
return (
|
||||
/** @type {!module:ol/tilegrid/TileGrid} */ (this.tileGridForProjection[projKey])
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -244,9 +246,9 @@ TileImage.prototype.getTileCacheForProjection = function(projection) {
|
||||
* @param {number} x Tile coordinate x.
|
||||
* @param {number} y Tile coordinate y.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection} projection Projection.
|
||||
* @param {string} key The key set on the tile.
|
||||
* @return {!module:ol/Tile~Tile} Tile.
|
||||
* @return {!module:ol/Tile} Tile.
|
||||
* @private
|
||||
*/
|
||||
TileImage.prototype.createTile_ = function(z, x, y, pixelRatio, projection, key) {
|
||||
@@ -273,7 +275,7 @@ TileImage.prototype.createTile_ = function(z, x, y, pixelRatio, projection, key)
|
||||
* @inheritDoc
|
||||
*/
|
||||
TileImage.prototype.getTile = function(z, x, y, pixelRatio, projection) {
|
||||
const sourceProjection = /** @type {!module:ol/proj/Projection~Projection} */ (this.getProjection());
|
||||
const sourceProjection = /** @type {!module:ol/proj/Projection} */ (this.getProjection());
|
||||
if (!ENABLE_RASTER_REPROJECTION ||
|
||||
!sourceProjection || !projection || equivalent(sourceProjection, projection)) {
|
||||
return this.getTileInternal(z, x, y, pixelRatio, sourceProjection || projection);
|
||||
@@ -283,7 +285,7 @@ TileImage.prototype.getTile = function(z, x, y, pixelRatio, projection) {
|
||||
let tile;
|
||||
const tileCoordKey = getKey(tileCoord);
|
||||
if (cache.containsKey(tileCoordKey)) {
|
||||
tile = /** @type {!module:ol/Tile~Tile} */ (cache.get(tileCoordKey));
|
||||
tile = /** @type {!module:ol/Tile} */ (cache.get(tileCoordKey));
|
||||
}
|
||||
const key = this.getKey();
|
||||
if (tile && tile.key == key) {
|
||||
@@ -322,8 +324,8 @@ TileImage.prototype.getTile = function(z, x, y, pixelRatio, projection) {
|
||||
* @param {number} x Tile coordinate x.
|
||||
* @param {number} y Tile coordinate y.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {!module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @return {!module:ol/Tile~Tile} Tile.
|
||||
* @param {!module:ol/proj/Projection} projection Projection.
|
||||
* @return {!module:ol/Tile} Tile.
|
||||
* @protected
|
||||
*/
|
||||
TileImage.prototype.getTileInternal = function(z, x, y, pixelRatio, projection) {
|
||||
@@ -384,7 +386,7 @@ TileImage.prototype.setRenderReprojectionEdges = function(render) {
|
||||
* for optimization reasons (custom tile size, resolutions, ...).
|
||||
*
|
||||
* @param {module:ol/proj~ProjectionLike} projection Projection.
|
||||
* @param {module:ol/tilegrid/TileGrid~TileGrid} tilegrid Tile grid to use for the projection.
|
||||
* @param {module:ol/tilegrid/TileGrid} tilegrid Tile grid to use for the projection.
|
||||
* @api
|
||||
*/
|
||||
TileImage.prototype.setTileGridForProjection = function(projection, tilegrid) {
|
||||
@@ -401,7 +403,7 @@ TileImage.prototype.setTileGridForProjection = function(projection, tilegrid) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/ImageTile~ImageTile} imageTile Image tile.
|
||||
* @param {module:ol/ImageTile} imageTile Image tile.
|
||||
* @param {string} src Source.
|
||||
*/
|
||||
function defaultTileLoadFunction(imageTile, src) {
|
||||
|
||||
Reference in New Issue
Block a user