Module type for ol.Tile
This commit is contained in:
@@ -106,7 +106,7 @@ TileSource.prototype.expireCache = function(projection, usedTiles) {
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @param {number} z Zoom level.
|
||||
* @param {module:ol/TileRange~TileRange} tileRange Tile range.
|
||||
* @param {function(ol.Tile):(boolean|undefined)} callback Called with each
|
||||
* @param {function(module:ol/Tile~Tile):(boolean|undefined)} callback Called with each
|
||||
* loaded tile. If the callback returns `false`, the tile will not be
|
||||
* considered loaded.
|
||||
* @return {boolean} The tile range is fully covered with loaded tiles.
|
||||
@@ -124,7 +124,7 @@ TileSource.prototype.forEachLoadedTile = function(projection, z, tileRange, call
|
||||
tileCoordKey = getKeyZXY(z, x, y);
|
||||
loaded = false;
|
||||
if (tileCache.containsKey(tileCoordKey)) {
|
||||
tile = /** @type {!ol.Tile} */ (tileCache.get(tileCoordKey));
|
||||
tile = /** @type {!module:ol/Tile~Tile} */ (tileCache.get(tileCoordKey));
|
||||
loaded = tile.getState() === TileState.LOADED;
|
||||
if (loaded) {
|
||||
loaded = (callback(tile) !== false);
|
||||
@@ -195,7 +195,7 @@ TileSource.prototype.getResolutions = function() {
|
||||
* @param {number} y Tile coordinate y.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @return {!ol.Tile} Tile.
|
||||
* @return {!module:ol/Tile~Tile} Tile.
|
||||
*/
|
||||
TileSource.prototype.getTile = function(z, x, y, pixelRatio, projection) {};
|
||||
|
||||
@@ -316,7 +316,7 @@ TileSource.prototype.useTile = UNDEFINED;
|
||||
* @extends {ol.events.Event}
|
||||
* @implements {oli.source.Tile.Event}
|
||||
* @param {string} type Type.
|
||||
* @param {ol.Tile} tile The tile.
|
||||
* @param {module:ol/Tile~Tile} tile The tile.
|
||||
*/
|
||||
export const TileSourceEvent = function(type, tile) {
|
||||
|
||||
@@ -324,7 +324,7 @@ export const TileSourceEvent = function(type, tile) {
|
||||
|
||||
/**
|
||||
* The tile related to the event.
|
||||
* @type {ol.Tile}
|
||||
* @type {module:ol/Tile~Tile}
|
||||
* @api
|
||||
*/
|
||||
this.tile = tile;
|
||||
|
||||
@@ -12,7 +12,7 @@ import {getKeyZXY} from '../tilecoord.js';
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.Tile}
|
||||
* @extends {module:ol/Tile~Tile}
|
||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
||||
* @param {module:ol/size~Size} tileSize Tile size.
|
||||
* @param {string} text Text.
|
||||
|
||||
@@ -206,7 +206,7 @@ TileImage.prototype.getTileCacheForProjection = function(projection) {
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @param {string} key The key set on the tile.
|
||||
* @return {!ol.Tile} Tile.
|
||||
* @return {!module:ol/Tile~Tile} Tile.
|
||||
* @private
|
||||
*/
|
||||
TileImage.prototype.createTile_ = function(z, x, y, pixelRatio, projection, key) {
|
||||
@@ -243,7 +243,7 @@ TileImage.prototype.getTile = function(z, x, y, pixelRatio, projection) {
|
||||
let tile;
|
||||
const tileCoordKey = getKey(tileCoord);
|
||||
if (cache.containsKey(tileCoordKey)) {
|
||||
tile = /** @type {!ol.Tile} */ (cache.get(tileCoordKey));
|
||||
tile = /** @type {!module:ol/Tile~Tile} */ (cache.get(tileCoordKey));
|
||||
}
|
||||
const key = this.getKey();
|
||||
if (tile && tile.key == key) {
|
||||
@@ -283,7 +283,7 @@ TileImage.prototype.getTile = function(z, x, y, pixelRatio, projection) {
|
||||
* @param {number} y Tile coordinate y.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {!module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @return {!ol.Tile} Tile.
|
||||
* @return {!module:ol/Tile~Tile} Tile.
|
||||
* @protected
|
||||
*/
|
||||
TileImage.prototype.getTileInternal = function(z, x, y, pixelRatio, projection) {
|
||||
|
||||
@@ -19,7 +19,7 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js';
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.Tile}
|
||||
* @extends {module:ol/Tile~Tile}
|
||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
||||
* @param {module:ol/TileState~TileState} state State.
|
||||
* @param {string} src Image source URI.
|
||||
@@ -449,7 +449,7 @@ UTFGrid.prototype.handleTileJSONResponse = function(tileJSON) {
|
||||
UTFGrid.prototype.getTile = function(z, x, y, pixelRatio, projection) {
|
||||
const tileCoordKey = getKeyZXY(z, x, y);
|
||||
if (this.tileCache.containsKey(tileCoordKey)) {
|
||||
return /** @type {!ol.Tile} */ (this.tileCache.get(tileCoordKey));
|
||||
return /** @type {!module:ol/Tile~Tile} */ (this.tileCache.get(tileCoordKey));
|
||||
} else {
|
||||
const tileCoord = [z, x, y];
|
||||
const urlTileCoord =
|
||||
|
||||
@@ -116,7 +116,7 @@ UrlTile.prototype.getUrls = function() {
|
||||
* @protected
|
||||
*/
|
||||
UrlTile.prototype.handleTileChange = function(event) {
|
||||
const tile = /** @type {ol.Tile} */ (event.target);
|
||||
const tile = /** @type {module:ol/Tile~Tile} */ (event.target);
|
||||
const uid = getUid(tile);
|
||||
const tileState = tile.getState();
|
||||
let type;
|
||||
|
||||
@@ -112,7 +112,7 @@ VectorTileSource.prototype.clear = function() {
|
||||
VectorTileSource.prototype.getTile = function(z, x, y, pixelRatio, projection) {
|
||||
const tileCoordKey = getKeyZXY(z, x, y);
|
||||
if (this.tileCache.containsKey(tileCoordKey)) {
|
||||
return /** @type {!ol.Tile} */ (this.tileCache.get(tileCoordKey));
|
||||
return /** @type {!module:ol/Tile~Tile} */ (this.tileCache.get(tileCoordKey));
|
||||
} else {
|
||||
const tileCoord = [z, x, y];
|
||||
const urlTileCoord = this.getTileCoordForTileUrlFunction(
|
||||
|
||||
Reference in New Issue
Block a user