From 615ae71a8fecb3c938652def677b92317804e38d Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 26 Mar 2020 11:37:22 +0100 Subject: [PATCH] Remove all inheritDoc tags from src/ol/source --- src/ol/source/Cluster.js | 9 ++++++--- src/ol/source/IIIF.js | 2 +- src/ol/source/Image.js | 1 - src/ol/source/ImageArcGISRest.js | 6 +++++- src/ol/source/ImageCanvas.js | 8 ++++++-- src/ol/source/ImageMapGuide.js | 6 +++++- src/ol/source/ImageStatic.js | 8 ++++++-- src/ol/source/ImageWMS.js | 6 +++++- src/ol/source/Raster.js | 8 ++++++-- src/ol/source/Tile.js | 2 +- src/ol/source/TileArcGISRest.js | 6 ++++-- src/ol/source/TileDebug.js | 10 +++++----- src/ol/source/TileImage.js | 32 ++++++++++++++++++++------------ src/ol/source/TileWMS.js | 9 +++++---- src/ol/source/UTFGrid.js | 20 +++++++++++++------- src/ol/source/UrlTile.js | 5 ++++- src/ol/source/VectorTile.js | 21 ++++++++++++++++----- src/ol/source/WMTS.js | 2 +- src/ol/source/Zoomify.js | 5 +++-- 19 files changed, 112 insertions(+), 54 deletions(-) diff --git a/src/ol/source/Cluster.js b/src/ol/source/Cluster.js index 535956bc67..4ee85445e9 100644 --- a/src/ol/source/Cluster.js +++ b/src/ol/source/Cluster.js @@ -91,7 +91,9 @@ class Cluster extends VectorSource { } /** - * @override + * Remove all features from the source. + * @param {boolean=} opt_fast Skip dispatching of {@link module:ol/source/Vector.VectorSourceEvent#removefeature} events. + * @api */ clear(opt_fast) { this.features.length = 0; @@ -117,7 +119,9 @@ class Cluster extends VectorSource { } /** - * @inheritDoc + * @param {import("../extent.js").Extent} extent Extent. + * @param {number} resolution Resolution. + * @param {import("../proj/Projection.js").default} projection Projection. */ loadFeatures(extent, resolution, projection) { this.source.loadFeatures(extent, resolution, projection); @@ -157,7 +161,6 @@ class Cluster extends VectorSource { /** * Handle the source changing. - * @override */ refresh() { this.clear(); diff --git a/src/ol/source/IIIF.js b/src/ol/source/IIIF.js index 9f28e3a1f2..5ec6dc6ee1 100644 --- a/src/ol/source/IIIF.js +++ b/src/ol/source/IIIF.js @@ -286,7 +286,7 @@ class IIIF extends TileImage { }); /** - * @inheritDoc + * @type {number} */ this.zDirection = options.zDirection; diff --git a/src/ol/source/Image.js b/src/ol/source/Image.js index cf93b63ebe..632595e6d8 100644 --- a/src/ol/source/Image.js +++ b/src/ol/source/Image.js @@ -120,7 +120,6 @@ class ImageSource extends Source { /** * @return {Array} Resolutions. - * @override */ getResolutions() { return this.resolutions_; diff --git a/src/ol/source/ImageArcGISRest.js b/src/ol/source/ImageArcGISRest.js index 7638353474..5c36d346aa 100644 --- a/src/ol/source/ImageArcGISRest.js +++ b/src/ol/source/ImageArcGISRest.js @@ -134,7 +134,11 @@ class ImageArcGISRest extends ImageSource { } /** - * @inheritDoc + * @param {import("../extent.js").Extent} extent Extent. + * @param {number} resolution Resolution. + * @param {number} pixelRatio Pixel ratio. + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {import("../Image.js").default} Single image. */ getImageInternal(extent, resolution, pixelRatio, projection) { diff --git a/src/ol/source/ImageCanvas.js b/src/ol/source/ImageCanvas.js index b0988f5f28..ae3dc1afaa 100644 --- a/src/ol/source/ImageCanvas.js +++ b/src/ol/source/ImageCanvas.js @@ -90,8 +90,12 @@ class ImageCanvasSource extends ImageSource { } /** - * @inheritDoc - */ + * @param {import("../extent.js").Extent} extent Extent. + * @param {number} resolution Resolution. + * @param {number} pixelRatio Pixel ratio. + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {import("../ImageCanvas.js").default} Single image. + */ getImageInternal(extent, resolution, pixelRatio, projection) { resolution = this.findNearestResolution(resolution); diff --git a/src/ol/source/ImageMapGuide.js b/src/ol/source/ImageMapGuide.js index d39f82e111..964fb311b7 100644 --- a/src/ol/source/ImageMapGuide.js +++ b/src/ol/source/ImageMapGuide.js @@ -132,7 +132,11 @@ class ImageMapGuide extends ImageSource { } /** - * @inheritDoc + * @param {import("../extent.js").Extent} extent Extent. + * @param {number} resolution Resolution. + * @param {number} pixelRatio Pixel ratio. + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {import("../Image.js").default} Single image. */ getImageInternal(extent, resolution, pixelRatio, projection) { resolution = this.findNearestResolution(resolution); diff --git a/src/ol/source/ImageStatic.js b/src/ol/source/ImageStatic.js index 146a0fb1d5..20112e3f96 100644 --- a/src/ol/source/ImageStatic.js +++ b/src/ol/source/ImageStatic.js @@ -86,7 +86,11 @@ class Static extends ImageSource { } /** - * @inheritDoc + * @param {import("../extent.js").Extent} extent Extent. + * @param {number} resolution Resolution. + * @param {number} pixelRatio Pixel ratio. + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {import("../Image.js").default} Single image. */ getImageInternal(extent, resolution, pixelRatio, projection) { if (intersects(extent, this.image_.getExtent())) { @@ -105,7 +109,7 @@ class Static extends ImageSource { } /** - * @inheritDoc + * @param {import("../events/Event.js").default} evt Event. */ handleImageChange(evt) { if (this.image_.getState() == ImageState.LOADED) { diff --git a/src/ol/source/ImageWMS.js b/src/ol/source/ImageWMS.js index a32b9b061e..07134a5023 100644 --- a/src/ol/source/ImageWMS.js +++ b/src/ol/source/ImageWMS.js @@ -248,7 +248,11 @@ class ImageWMS extends ImageSource { } /** - * @inheritDoc + * @param {import("../extent.js").Extent} extent Extent. + * @param {number} resolution Resolution. + * @param {number} pixelRatio Pixel ratio. + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {import("../Image.js").default} Single image. */ getImageInternal(extent, resolution, pixelRatio, projection) { diff --git a/src/ol/source/Raster.js b/src/ol/source/Raster.js index 725e1d220c..4f976233d4 100644 --- a/src/ol/source/Raster.js +++ b/src/ol/source/Raster.js @@ -315,7 +315,11 @@ class RasterSource extends ImageSource { } /** - * @inheritDoc + * @param {import("../extent.js").Extent} extent Extent. + * @param {number} resolution Resolution. + * @param {number} pixelRatio Pixel ratio. + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {import("../ImageCanvas.js").default} Single image. */ getImage(extent, resolution, pixelRatio, projection) { if (!this.allSourcesReady_()) { @@ -409,7 +413,7 @@ class RasterSource extends ImageSource { } /** - * @override + * @return {null} not implemented */ getImageInternal() { return null; // not implemented diff --git a/src/ol/source/Tile.js b/src/ol/source/Tile.js index 8e5246e816..4be18cfb6a 100644 --- a/src/ol/source/Tile.js +++ b/src/ol/source/Tile.js @@ -205,7 +205,7 @@ class TileSource extends Source { } /** - * @inheritDoc + * @return {Array} Resolutions. */ getResolutions() { return this.tileGrid.getResolutions(); diff --git a/src/ol/source/TileArcGISRest.js b/src/ol/source/TileArcGISRest.js index cd347f3c5d..24415ce0d9 100644 --- a/src/ol/source/TileArcGISRest.js +++ b/src/ol/source/TileArcGISRest.js @@ -170,10 +170,12 @@ class TileArcGISRest extends TileImage { } /** - * @inheritDoc + * Get the tile pixel ratio for this source. + * @param {number} pixelRatio Pixel ratio. + * @return {number} Tile pixel ratio. */ getTilePixelRatio(pixelRatio) { - return this.hidpi_ ? /** @type {number} */ (pixelRatio) : 1; + return this.hidpi_ ? pixelRatio : 1; } /** diff --git a/src/ol/source/TileDebug.js b/src/ol/source/TileDebug.js index 127fb23f3f..3c4ac9f849 100644 --- a/src/ol/source/TileDebug.js +++ b/src/ol/source/TileDebug.js @@ -68,9 +68,6 @@ class LabeledTile extends Tile { } } - /** - * @override - */ load() {} } @@ -118,8 +115,11 @@ class TileDebug extends XYZ { } /** - * @inheritDoc - */ + * @param {number} z Tile coordinate z. + * @param {number} x Tile coordinate x. + * @param {number} y Tile coordinate y. + * @return {!LabeledTile} Tile. + */ getTile(z, x, y) { const tileCoordKey = getKeyZXY(z, x, y); if (this.tileCache.containsKey(tileCoordKey)) { diff --git a/src/ol/source/TileImage.js b/src/ol/source/TileImage.js index 7e32dd149b..7c8ec6dc3d 100644 --- a/src/ol/source/TileImage.js +++ b/src/ol/source/TileImage.js @@ -131,7 +131,7 @@ class TileImage extends UrlTile { } /** - * @inheritDoc + * @return {boolean} Can expire cache. */ canExpireCache() { if (!ENABLE_RASTER_REPROJECTION) { @@ -150,7 +150,8 @@ class TileImage extends UrlTile { } /** - * @inheritDoc + * @param {import("../proj/Projection.js").default} projection Projection. + * @param {!Object} usedTiles Used tiles. */ expireCache(projection, usedTiles) { if (!ENABLE_RASTER_REPROJECTION) { @@ -167,7 +168,8 @@ class TileImage extends UrlTile { } /** - * @inheritDoc + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {number} Gutter. */ getGutterForProjection(projection) { if (ENABLE_RASTER_REPROJECTION && @@ -186,7 +188,8 @@ class TileImage extends UrlTile { } /** - * @inheritDoc + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {boolean} Opaque. */ getOpaque(projection) { if (ENABLE_RASTER_REPROJECTION && @@ -198,7 +201,8 @@ class TileImage extends UrlTile { } /** - * @inheritDoc + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {!import("../tilegrid/TileGrid.js").default} Tile grid. */ getTileGridForProjection(projection) { if (!ENABLE_RASTER_REPROJECTION) { @@ -212,14 +216,13 @@ class TileImage extends UrlTile { if (!(projKey in this.tileGridForProjection)) { this.tileGridForProjection[projKey] = getTileGridForProjection(projection); } - return ( - /** @type {!import("../tilegrid/TileGrid.js").default} */ (this.tileGridForProjection[projKey]) - ); + return this.tileGridForProjection[projKey]; } } /** - * @inheritDoc + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {import("../TileCache.js").default} Tile cache. */ getTileCacheForProjection(projection) { if (!ENABLE_RASTER_REPROJECTION) { @@ -265,10 +268,15 @@ class TileImage extends UrlTile { } /** - * @inheritDoc + * @param {number} z Tile coordinate z. + * @param {number} x Tile coordinate x. + * @param {number} y Tile coordinate y. + * @param {number} pixelRatio Pixel ratio. + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {!import("../Tile.js").default} Tile. */ getTile(z, x, y, pixelRatio, projection) { - const sourceProjection = /** @type {!import("../proj/Projection.js").default} */ (this.getProjection()); + const sourceProjection = this.getProjection(); if (!ENABLE_RASTER_REPROJECTION || !sourceProjection || !projection || equivalent(sourceProjection, projection)) { return this.getTileInternal(z, x, y, pixelRatio, sourceProjection || projection); @@ -278,7 +286,7 @@ class TileImage extends UrlTile { let tile; const tileCoordKey = getKey(tileCoord); if (cache.containsKey(tileCoordKey)) { - tile = /** @type {!import("../Tile.js").default} */ (cache.get(tileCoordKey)); + tile = cache.get(tileCoordKey); } const key = this.getKey(); if (tile && tile.key == key) { diff --git a/src/ol/source/TileWMS.js b/src/ol/source/TileWMS.js index 9ee929b63c..59d7a9a445 100644 --- a/src/ol/source/TileWMS.js +++ b/src/ol/source/TileWMS.js @@ -260,7 +260,7 @@ class TileWMS extends TileImage { } /** - * @inheritDoc + * @return {number} Gutter. */ getGutter() { return this.gutter_; @@ -349,11 +349,12 @@ class TileWMS extends TileImage { } /** - * @inheritDoc + * Get the tile pixel ratio for this source. + * @param {number} pixelRatio Pixel ratio. + * @return {number} Tile pixel ratio. */ getTilePixelRatio(pixelRatio) { - return (!this.hidpi_ || this.serverType_ === undefined) ? 1 : - /** @type {number} */ (pixelRatio); + return (!this.hidpi_ || this.serverType_ === undefined) ? 1 : pixelRatio; } /** diff --git a/src/ol/source/UTFGrid.js b/src/ol/source/UTFGrid.js index 8254fb70c4..7c0b30cf61 100644 --- a/src/ol/source/UTFGrid.js +++ b/src/ol/source/UTFGrid.js @@ -162,7 +162,8 @@ export class CustomTile extends Tile { /** - * @inheritDoc + * Return the key to be used for all tiles in the source. + * @return {string} The key for all tiles. */ getKey() { return this.src_; @@ -244,7 +245,6 @@ export class CustomTile extends Tile { /** - * @override */ load() { if (this.preemptive_) { @@ -467,14 +467,17 @@ class UTFGrid extends TileSource { /** - * @inheritDoc + * @param {number} z Tile coordinate z. + * @param {number} x Tile coordinate x. + * @param {number} y Tile coordinate y. + * @param {number} pixelRatio Pixel ratio. + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {!CustomTile} Tile. */ getTile(z, x, y, pixelRatio, projection) { const tileCoordKey = getKeyZXY(z, x, y); if (this.tileCache.containsKey(tileCoordKey)) { - return ( - /** @type {!import("../Tile.js").default} */ (this.tileCache.get(tileCoordKey)) - ); + return this.tileCache.get(tileCoordKey); } else { const tileCoord = [z, x, y]; const urlTileCoord = @@ -494,7 +497,10 @@ class UTFGrid extends TileSource { /** - * @inheritDoc + * Marks a tile coord as being used, without triggering a load. + * @param {number} z Tile coordinate z. + * @param {number} x Tile coordinate x. + * @param {number} y Tile coordinate y. */ useTile(z, x, y) { const tileCoordKey = getKeyZXY(z, x, y); diff --git a/src/ol/source/UrlTile.js b/src/ol/source/UrlTile.js index ebc3f5a8ed..17bc269b66 100644 --- a/src/ol/source/UrlTile.js +++ b/src/ol/source/UrlTile.js @@ -201,7 +201,10 @@ class UrlTile extends TileSource { } /** - * @inheritDoc + * Marks a tile coord as being used, without triggering a load. + * @param {number} z Tile coordinate z. + * @param {number} x Tile coordinate x. + * @param {number} y Tile coordinate y. */ useTile(z, x, y) { const tileCoordKey = getKeyZXY(z, x, y); diff --git a/src/ol/source/VectorTile.js b/src/ol/source/VectorTile.js index 42e4a1f4b9..07cabf7ffe 100644 --- a/src/ol/source/VectorTile.js +++ b/src/ol/source/VectorTile.js @@ -341,14 +341,19 @@ class VectorTile extends UrlTile { } /** - * @inheritDoc + * @param {number} z Tile coordinate z. + * @param {number} x Tile coordinate x. + * @param {number} y Tile coordinate y. + * @param {number} pixelRatio Pixel ratio. + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {!VectorRenderTile} Tile. */ getTile(z, x, y, pixelRatio, projection) { const coordKey = getKeyZXY(z, x, y); const key = this.getKey(); let tile; if (this.tileCache.containsKey(coordKey)) { - tile = /** @type {!import("../Tile.js").default} */ (this.tileCache.get(coordKey)); + tile = this.tileCache.get(coordKey); if (tile.key === key) { return tile; } @@ -395,7 +400,8 @@ class VectorTile extends UrlTile { } /** - * @inheritDoc + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {!import("../tilegrid/TileGrid.js").default} Tile grid. */ getTileGridForProjection(projection) { const code = projection.getCode(); @@ -412,14 +418,19 @@ class VectorTile extends UrlTile { } /** - * @inheritDoc + * Get the tile pixel ratio for this source. + * @param {number} pixelRatio Pixel ratio. + * @return {number} Tile pixel ratio. */ getTilePixelRatio(pixelRatio) { return pixelRatio; } /** - * @inheritDoc + * @param {number} z Z. + * @param {number} pixelRatio Pixel ratio. + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {import("../size.js").Size} Tile size. */ getTilePixelSize(z, pixelRatio, projection) { const tileGrid = this.getTileGridForProjection(projection); diff --git a/src/ol/source/WMTS.js b/src/ol/source/WMTS.js index 77663ad2a3..757ff108a3 100644 --- a/src/ol/source/WMTS.js +++ b/src/ol/source/WMTS.js @@ -152,7 +152,7 @@ class WMTS extends TileImage { /** * Set the URLs to use for requests. * URLs may contain OGC conform URL Template Variables: {TileMatrix}, {TileRow}, {TileCol}. - * @override + * @param {Array} urls URLs. */ setUrls(urls) { this.urls = urls; diff --git a/src/ol/source/Zoomify.js b/src/ol/source/Zoomify.js index 0c0e36533a..39fd155cf3 100644 --- a/src/ol/source/Zoomify.js +++ b/src/ol/source/Zoomify.js @@ -52,7 +52,8 @@ export class CustomTile extends ImageTile { } /** - * @inheritDoc + * Get the image element for this tile. + * @return {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} Image. */ getImage() { if (this.zoomifyImage_) { @@ -256,7 +257,7 @@ class Zoomify extends TileImage { }); /** - * @inheritDoc + * @type {number} */ this.zDirection = options.zDirection;