From 7e3e0e54ca21c52be82d20cb55130b9843c5b3ed Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 17 Jul 2018 09:12:50 +0200 Subject: [PATCH] Fix comments indentation --- src/ol/Disposable.js | 4 +- src/ol/Image.js | 80 ++++---- src/ol/ImageBase.js | 56 +++--- src/ol/ImageCanvas.js | 42 ++-- src/ol/Kinetic.js | 58 +++--- src/ol/MapBrowserEvent.js | 58 +++--- src/ol/TileRange.js | 46 ++--- src/ol/VectorTile.js | 184 +++++++++--------- src/ol/control/Control.js | 68 +++---- src/ol/control/ZoomToExtent.js | 16 +- .../circlereplay/defaultshader/Locations.js | 48 ++--- .../defaultshader/Locations.js | 52 ++--- .../polygonreplay/defaultshader/Locations.js | 24 +-- .../texturereplay/defaultshader/Locations.js | 40 ++-- .../webgl/defaultmapshader/Locations.js | 24 +-- .../webgl/tilelayershader/Locations.js | 16 +- src/ol/webgl/shaderlocations.mustache | 8 +- 17 files changed, 412 insertions(+), 412 deletions(-) diff --git a/src/ol/Disposable.js b/src/ol/Disposable.js index eec64ae19d..a7091d8e8f 100644 --- a/src/ol/Disposable.js +++ b/src/ol/Disposable.js @@ -9,8 +9,8 @@ import {UNDEFINED} from './functions.js'; */ class Disposable { /** - * Clean up. - */ + * Clean up. + */ dispose() { if (!this.disposed_) { this.disposed_ = true; diff --git a/src/ol/Image.js b/src/ol/Image.js index f04cc6c76d..4c2f62a5fa 100644 --- a/src/ol/Image.js +++ b/src/ol/Image.js @@ -44,53 +44,53 @@ class ImageWrapper { ImageBase.call(this, extent, resolution, pixelRatio, ImageState.IDLE); /** - * @private - * @type {string} - */ + * @private + * @type {string} + */ this.src_ = src; /** - * @private - * @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} - */ + * @private + * @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} + */ this.image_ = new Image(); if (crossOrigin !== null) { this.image_.crossOrigin = crossOrigin; } /** - * @private - * @type {Array.} - */ + * @private + * @type {Array.} + */ this.imageListenerKeys_ = null; /** - * @protected - * @type {module:ol/ImageState} - */ + * @protected + * @type {module:ol/ImageState} + */ this.state = ImageState.IDLE; /** - * @private - * @type {module:ol/Image~LoadFunction} - */ + * @private + * @type {module:ol/Image~LoadFunction} + */ this.imageLoadFunction_ = imageLoadFunction; } /** - * @inheritDoc - * @api - */ + * @inheritDoc + * @api + */ getImage() { return this.image_; } /** - * Tracks loading or read errors. - * - * @private - */ + * Tracks loading or read errors. + * + * @private + */ handleImageError_() { this.state = ImageState.ERROR; this.unlistenImage_(); @@ -98,10 +98,10 @@ class ImageWrapper { } /** - * Tracks successful image load. - * - * @private - */ + * Tracks successful image load. + * + * @private + */ handleImageLoad_() { if (this.resolution === undefined) { this.resolution = getHeight(this.extent) / this.image_.height; @@ -112,38 +112,38 @@ class ImageWrapper { } /** - * Load the image or retry if loading previously failed. - * Loading is taken care of by the tile queue, and calling this method is - * only needed for preloading or for reloading in case of an error. - * @override - * @api - */ + * Load the image or retry if loading previously failed. + * Loading is taken care of by the tile queue, and calling this method is + * only needed for preloading or for reloading in case of an error. + * @override + * @api + */ load() { if (this.state == ImageState.IDLE || this.state == ImageState.ERROR) { this.state = ImageState.LOADING; this.changed(); this.imageListenerKeys_ = [ listenOnce(this.image_, EventType.ERROR, - this.handleImageError_, this), + this.handleImageError_, this), listenOnce(this.image_, EventType.LOAD, - this.handleImageLoad_, this) + this.handleImageLoad_, this) ]; this.imageLoadFunction_(this, this.src_); } } /** - * @param {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} image Image. - */ + * @param {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} image Image. + */ setImage(image) { this.image_ = image; } /** - * Discards event handlers which listen for load completion or errors. - * - * @private - */ + * Discards event handlers which listen for load completion or errors. + * + * @private + */ unlistenImage_() { this.imageListenerKeys_.forEach(unlistenByKey); this.imageListenerKeys_ = null; diff --git a/src/ol/ImageBase.js b/src/ol/ImageBase.js index a0e4ec866a..f6b16e6785 100644 --- a/src/ol/ImageBase.js +++ b/src/ol/ImageBase.js @@ -20,76 +20,76 @@ class ImageBase { EventTarget.call(this); /** - * @protected - * @type {module:ol/extent~Extent} - */ + * @protected + * @type {module:ol/extent~Extent} + */ this.extent = extent; /** - * @private - * @type {number} - */ + * @private + * @type {number} + */ this.pixelRatio_ = pixelRatio; /** - * @protected - * @type {number|undefined} - */ + * @protected + * @type {number|undefined} + */ this.resolution = resolution; /** - * @protected - * @type {module:ol/ImageState} - */ + * @protected + * @type {module:ol/ImageState} + */ this.state = state; } /** - * @protected - */ + * @protected + */ changed() { this.dispatchEvent(EventType.CHANGE); } /** - * @return {module:ol/extent~Extent} Extent. - */ + * @return {module:ol/extent~Extent} Extent. + */ getExtent() { return this.extent; } /** - * @abstract - * @return {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} Image. - */ + * @abstract + * @return {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} Image. + */ getImage() {} /** - * @return {number} PixelRatio. - */ + * @return {number} PixelRatio. + */ getPixelRatio() { return this.pixelRatio_; } /** - * @return {number} Resolution. - */ + * @return {number} Resolution. + */ getResolution() { return /** @type {number} */ (this.resolution); } /** - * @return {module:ol/ImageState} State. - */ + * @return {module:ol/ImageState} State. + */ getState() { return this.state; } /** - * Load not yet loaded URI. - * @abstract - */ + * Load not yet loaded URI. + * @abstract + */ load() {} } diff --git a/src/ol/ImageCanvas.js b/src/ol/ImageCanvas.js index ea3f2d362e..e95bb8852a 100644 --- a/src/ol/ImageCanvas.js +++ b/src/ol/ImageCanvas.js @@ -30,10 +30,10 @@ class ImageCanvas { constructor(extent, resolution, pixelRatio, canvas, opt_loader) { /** - * Optional canvas loader function. - * @type {?module:ol/ImageCanvas~Loader} - * @private - */ + * Optional canvas loader function. + * @type {?module:ol/ImageCanvas~Loader} + * @private + */ this.loader_ = opt_loader !== undefined ? opt_loader : null; const state = opt_loader !== undefined ? ImageState.IDLE : ImageState.LOADED; @@ -41,32 +41,32 @@ class ImageCanvas { ImageBase.call(this, extent, resolution, pixelRatio, state); /** - * @private - * @type {HTMLCanvasElement} - */ + * @private + * @type {HTMLCanvasElement} + */ this.canvas_ = canvas; /** - * @private - * @type {Error} - */ + * @private + * @type {Error} + */ this.error_ = null; } /** - * Get any error associated with asynchronous rendering. - * @return {Error} Any error that occurred during rendering. - */ + * Get any error associated with asynchronous rendering. + * @return {Error} Any error that occurred during rendering. + */ getError() { return this.error_; } /** - * Handle async drawing complete. - * @param {Error} err Any error during drawing. - * @private - */ + * Handle async drawing complete. + * @param {Error} err Any error during drawing. + * @private + */ handleLoad_(err) { if (err) { this.error_ = err; @@ -78,8 +78,8 @@ class ImageCanvas { } /** - * @inheritDoc - */ + * @inheritDoc + */ load() { if (this.state == ImageState.IDLE) { this.state = ImageState.LOADING; @@ -89,8 +89,8 @@ class ImageCanvas { } /** - * @return {HTMLCanvasElement} Canvas element. - */ + * @return {HTMLCanvasElement} Canvas element. + */ getImage() { return this.canvas_; } diff --git a/src/ol/Kinetic.js b/src/ol/Kinetic.js index 73090f8b9d..ef5be333e9 100644 --- a/src/ol/Kinetic.js +++ b/src/ol/Kinetic.js @@ -18,45 +18,45 @@ class Kinetic { constructor(decay, minVelocity, delay) { /** - * @private - * @type {number} - */ + * @private + * @type {number} + */ this.decay_ = decay; /** - * @private - * @type {number} - */ + * @private + * @type {number} + */ this.minVelocity_ = minVelocity; /** - * @private - * @type {number} - */ + * @private + * @type {number} + */ this.delay_ = delay; /** - * @private - * @type {Array.} - */ + * @private + * @type {Array.} + */ this.points_ = []; /** - * @private - * @type {number} - */ + * @private + * @type {number} + */ this.angle_ = 0; /** - * @private - * @type {number} - */ + * @private + * @type {number} + */ this.initialVelocity_ = 0; } /** - * FIXME empty description for jsdoc - */ + * FIXME empty description for jsdoc + */ begin() { this.points_.length = 0; this.angle_ = 0; @@ -64,16 +64,16 @@ class Kinetic { } /** - * @param {number} x X. - * @param {number} y Y. - */ + * @param {number} x X. + * @param {number} y Y. + */ update(x, y) { this.points_.push(x, y, Date.now()); } /** - * @return {boolean} Whether we should do kinetic animation. - */ + * @return {boolean} Whether we should do kinetic animation. + */ end() { if (this.points_.length < 6) { // at least 2 points are required (i.e. there must be at least 6 elements @@ -110,15 +110,15 @@ class Kinetic { } /** - * @return {number} Total distance travelled (pixels). - */ + * @return {number} Total distance travelled (pixels). + */ getDistance() { return (this.minVelocity_ - this.initialVelocity_) / this.decay_; } /** - * @return {number} Angle of the kinetic panning animation (radians). - */ + * @return {number} Angle of the kinetic panning animation (radians). + */ getAngle() { return this.angle_; } diff --git a/src/ol/MapBrowserEvent.js b/src/ol/MapBrowserEvent.js index ab11a55549..e8a7a7e201 100644 --- a/src/ol/MapBrowserEvent.js +++ b/src/ol/MapBrowserEvent.js @@ -23,55 +23,55 @@ class MapBrowserEvent { MapEvent.call(this, type, map, opt_frameState); /** - * The original browser event. - * @const - * @type {Event} - * @api - */ + * The original browser event. + * @const + * @type {Event} + * @api + */ this.originalEvent = browserEvent; /** - * The map pixel relative to the viewport corresponding to the original browser event. - * @type {module:ol~Pixel} - * @api - */ + * The map pixel relative to the viewport corresponding to the original browser event. + * @type {module:ol~Pixel} + * @api + */ this.pixel = map.getEventPixel(browserEvent); /** - * The coordinate in view projection corresponding to the original browser event. - * @type {module:ol/coordinate~Coordinate} - * @api - */ + * The coordinate in view projection corresponding to the original browser event. + * @type {module:ol/coordinate~Coordinate} + * @api + */ this.coordinate = map.getCoordinateFromPixel(this.pixel); /** - * Indicates if the map is currently being dragged. Only set for - * `POINTERDRAG` and `POINTERMOVE` events. Default is `false`. - * - * @type {boolean} - * @api - */ + * Indicates if the map is currently being dragged. Only set for + * `POINTERDRAG` and `POINTERMOVE` events. Default is `false`. + * + * @type {boolean} + * @api + */ this.dragging = opt_dragging !== undefined ? opt_dragging : false; } /** - * Prevents the default browser action. - * @see https://developer.mozilla.org/en-US/docs/Web/API/event.preventDefault - * @override - * @api - */ + * Prevents the default browser action. + * @see https://developer.mozilla.org/en-US/docs/Web/API/event.preventDefault + * @override + * @api + */ preventDefault() { MapEvent.prototype.preventDefault.call(this); this.originalEvent.preventDefault(); } /** - * Prevents further propagation of the current event. - * @see https://developer.mozilla.org/en-US/docs/Web/API/event.stopPropagation - * @override - * @api - */ + * Prevents further propagation of the current event. + * @see https://developer.mozilla.org/en-US/docs/Web/API/event.stopPropagation + * @override + * @api + */ stopPropagation() { MapEvent.prototype.stopPropagation.call(this); this.originalEvent.stopPropagation(); diff --git a/src/ol/TileRange.js b/src/ol/TileRange.js index d3be21b15d..127b6f7b95 100644 --- a/src/ol/TileRange.js +++ b/src/ol/TileRange.js @@ -16,65 +16,65 @@ class TileRange { constructor(minX, maxX, minY, maxY) { /** - * @type {number} - */ + * @type {number} + */ this.minX = minX; /** - * @type {number} - */ + * @type {number} + */ this.maxX = maxX; /** - * @type {number} - */ + * @type {number} + */ this.minY = minY; /** - * @type {number} - */ + * @type {number} + */ this.maxY = maxY; } /** - * @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate. - * @return {boolean} Contains tile coordinate. - */ + * @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate. + * @return {boolean} Contains tile coordinate. + */ contains(tileCoord) { return this.containsXY(tileCoord[1], tileCoord[2]); } /** - * @param {module:ol/TileRange} tileRange Tile range. - * @return {boolean} Contains. - */ + * @param {module:ol/TileRange} tileRange Tile range. + * @return {boolean} Contains. + */ containsTileRange(tileRange) { return this.minX <= tileRange.minX && tileRange.maxX <= this.maxX && this.minY <= tileRange.minY && tileRange.maxY <= this.maxY; } /** - * @param {number} x Tile coordinate x. - * @param {number} y Tile coordinate y. - * @return {boolean} Contains coordinate. - */ + * @param {number} x Tile coordinate x. + * @param {number} y Tile coordinate y. + * @return {boolean} Contains coordinate. + */ containsXY(x, y) { return this.minX <= x && x <= this.maxX && this.minY <= y && y <= this.maxY; } /** - * @param {module:ol/TileRange} tileRange Tile range. - * @return {boolean} Equals. - */ + * @param {module:ol/TileRange} tileRange Tile range. + * @return {boolean} Equals. + */ equals(tileRange) { return this.minX == tileRange.minX && this.minY == tileRange.minY && this.maxX == tileRange.maxX && this.maxY == tileRange.maxY; } /** - * @param {module:ol/TileRange} tileRange Tile range. - */ + * @param {module:ol/TileRange} tileRange Tile range. + */ extend(tileRange) { if (tileRange.minX < this.minX) { this.minX = tileRange.minX; diff --git a/src/ol/VectorTile.js b/src/ol/VectorTile.js index ff2591a255..cf7f56c937 100644 --- a/src/ol/VectorTile.js +++ b/src/ol/VectorTile.js @@ -34,64 +34,64 @@ class VectorTile { Tile.call(this, tileCoord, state, opt_options); /** - * @type {number} - */ + * @type {number} + */ this.consumers = 0; /** - * @private - * @type {module:ol/extent~Extent} - */ + * @private + * @type {module:ol/extent~Extent} + */ this.extent_ = null; /** - * @private - * @type {module:ol/format/Feature} - */ + * @private + * @type {module:ol/format/Feature} + */ this.format_ = format; /** - * @private - * @type {Array.} - */ + * @private + * @type {Array.} + */ this.features_ = null; /** - * @private - * @type {module:ol/featureloader~FeatureLoader} - */ + * @private + * @type {module:ol/featureloader~FeatureLoader} + */ this.loader_; /** - * Data projection - * @private - * @type {module:ol/proj/Projection} - */ + * Data projection + * @private + * @type {module:ol/proj/Projection} + */ this.projection_ = null; /** - * @private - * @type {Object.} - */ + * @private + * @type {Object.} + */ this.replayGroups_ = {}; /** - * @private - * @type {module:ol/Tile~LoadFunction} - */ + * @private + * @type {module:ol/Tile~LoadFunction} + */ this.tileLoadFunction_ = tileLoadFunction; /** - * @private - * @type {string} - */ + * @private + * @type {string} + */ this.url_ = src; } /** - * @inheritDoc - */ + * @inheritDoc + */ disposeInternal() { this.features_ = null; this.replayGroups_ = {}; @@ -101,62 +101,62 @@ class VectorTile { } /** - * Gets the extent of the vector tile. - * @return {module:ol/extent~Extent} The extent. - * @api - */ + * Gets the extent of the vector tile. + * @return {module:ol/extent~Extent} The extent. + * @api + */ getExtent() { return this.extent_ || DEFAULT_EXTENT; } /** - * Get the feature format assigned for reading this tile's features. - * @return {module:ol/format/Feature} Feature format. - * @api - */ + * Get the feature format assigned for reading this tile's features. + * @return {module:ol/format/Feature} Feature format. + * @api + */ getFormat() { return this.format_; } /** - * Get the features for this tile. Geometries will be in the projection returned - * by {@link module:ol/VectorTile~VectorTile#getProjection}. - * @return {Array.} Features. - * @api - */ + * Get the features for this tile. Geometries will be in the projection returned + * by {@link module:ol/VectorTile~VectorTile#getProjection}. + * @return {Array.} Features. + * @api + */ getFeatures() { return this.features_; } /** - * @inheritDoc - */ + * @inheritDoc + */ getKey() { return this.url_; } /** - * Get the feature projection of features returned by - * {@link module:ol/VectorTile~VectorTile#getFeatures}. - * @return {module:ol/proj/Projection} Feature projection. - * @api - */ + * Get the feature projection of features returned by + * {@link module:ol/VectorTile~VectorTile#getFeatures}. + * @return {module:ol/proj/Projection} Feature projection. + * @api + */ getProjection() { return this.projection_; } /** - * @param {module:ol/layer/Layer} layer Layer. - * @param {string} key Key. - * @return {module:ol/render/ReplayGroup} Replay group. - */ + * @param {module:ol/layer/Layer} layer Layer. + * @param {string} key Key. + * @return {module:ol/render/ReplayGroup} Replay group. + */ getReplayGroup(layer, key) { return this.replayGroups_[getUid(layer) + ',' + key]; } /** - * @inheritDoc - */ + * @inheritDoc + */ load() { if (this.state == TileState.IDLE) { this.setState(TileState.LOADING); @@ -166,11 +166,11 @@ class VectorTile { } /** - * Handler for successful tile load. - * @param {Array.} features The loaded features. - * @param {module:ol/proj/Projection} dataProjection Data projection. - * @param {module:ol/extent~Extent} extent Extent. - */ + * Handler for successful tile load. + * @param {Array.} features The loaded features. + * @param {module:ol/proj/Projection} dataProjection Data projection. + * @param {module:ol/extent~Extent} extent Extent. + */ onLoad(features, dataProjection, extent) { this.setProjection(dataProjection); this.setFeatures(features); @@ -178,64 +178,64 @@ class VectorTile { } /** - * Handler for tile load errors. - */ + * Handler for tile load errors. + */ onError() { this.setState(TileState.ERROR); } /** - * Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s - * `tileLoadFunction`. Sets the extent of the vector tile. This is only required - * for tiles in projections with `tile-pixels` as units. The extent should be - * set to `[0, 0, tilePixelSize, tilePixelSize]`, where `tilePixelSize` is - * calculated by multiplying the tile size with the tile pixel ratio. For - * sources using {@link module:ol/format/MVT~MVT} as feature format, the - * {@link module:ol/format/MVT~MVT#getLastExtent} method will return the correct - * extent. The default is `[0, 0, 4096, 4096]`. - * @param {module:ol/extent~Extent} extent The extent. - * @api - */ + * Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s + * `tileLoadFunction`. Sets the extent of the vector tile. This is only required + * for tiles in projections with `tile-pixels` as units. The extent should be + * set to `[0, 0, tilePixelSize, tilePixelSize]`, where `tilePixelSize` is + * calculated by multiplying the tile size with the tile pixel ratio. For + * sources using {@link module:ol/format/MVT~MVT} as feature format, the + * {@link module:ol/format/MVT~MVT#getLastExtent} method will return the correct + * extent. The default is `[0, 0, 4096, 4096]`. + * @param {module:ol/extent~Extent} extent The extent. + * @api + */ setExtent(extent) { this.extent_ = extent; } /** - * Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`. - * Sets the features for the tile. - * @param {Array.} features Features. - * @api - */ + * Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`. + * Sets the features for the tile. + * @param {Array.} features Features. + * @api + */ setFeatures(features) { this.features_ = features; this.setState(TileState.LOADED); } /** - * Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`. - * Sets the projection of the features that were added with - * {@link module:ol/VectorTile~VectorTile#setFeatures}. - * @param {module:ol/proj/Projection} projection Feature projection. - * @api - */ + * Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`. + * Sets the projection of the features that were added with + * {@link module:ol/VectorTile~VectorTile#setFeatures}. + * @param {module:ol/proj/Projection} projection Feature projection. + * @api + */ setProjection(projection) { this.projection_ = projection; } /** - * @param {module:ol/layer/Layer} layer Layer. - * @param {string} key Key. - * @param {module:ol/render/ReplayGroup} replayGroup Replay group. - */ + * @param {module:ol/layer/Layer} layer Layer. + * @param {string} key Key. + * @param {module:ol/render/ReplayGroup} replayGroup Replay group. + */ setReplayGroup(layer, key, replayGroup) { this.replayGroups_[getUid(layer) + ',' + key] = replayGroup; } /** - * Set the feature loader for reading this tile's features. - * @param {module:ol/featureloader~FeatureLoader} loader Feature loader. - * @api - */ + * Set the feature loader for reading this tile's features. + * @param {module:ol/featureloader~FeatureLoader} loader Feature loader. + * @api + */ setLoader(loader) { this.loader_ = loader; } diff --git a/src/ol/control/Control.js b/src/ol/control/Control.js index af040e02c6..d02c61f9fa 100644 --- a/src/ol/control/Control.js +++ b/src/ol/control/Control.js @@ -55,32 +55,32 @@ class Control { BaseObject.call(this); /** - * @protected - * @type {Element} - */ + * @protected + * @type {Element} + */ this.element = options.element ? options.element : null; /** - * @private - * @type {Element} - */ + * @private + * @type {Element} + */ this.target_ = null; /** - * @private - * @type {module:ol/PluggableMap} - */ + * @private + * @type {module:ol/PluggableMap} + */ this.map_ = null; /** - * @protected - * @type {!Array.} - */ + * @protected + * @type {!Array.} + */ this.listenerKeys = []; /** - * @type {function(module:ol/MapEvent)} - */ + * @type {function(module:ol/MapEvent)} + */ this.render = options.render ? options.render : UNDEFINED; if (options.target) { @@ -90,29 +90,29 @@ class Control { } /** - * @inheritDoc - */ + * @inheritDoc + */ disposeInternal() { removeNode(this.element); BaseObject.prototype.disposeInternal.call(this); } /** - * Get the map associated with this control. - * @return {module:ol/PluggableMap} Map. - * @api - */ + * Get the map associated with this control. + * @return {module:ol/PluggableMap} Map. + * @api + */ getMap() { return this.map_; } /** - * Remove the control from its current map and attach it to the new map. - * Subclasses may set up event handlers to get notified about changes to - * the map here. - * @param {module:ol/PluggableMap} map Map. - * @api - */ + * Remove the control from its current map and attach it to the new map. + * Subclasses may set up event handlers to get notified about changes to + * the map here. + * @param {module:ol/PluggableMap} map Map. + * @api + */ setMap(map) { if (this.map_) { removeNode(this.element); @@ -135,14 +135,14 @@ class Control { } /** - * This function is used to set a target element for the control. It has no - * effect if it is called after the control has been added to the map (i.e. - * after `setMap` is called on the control). If no `target` is set in the - * options passed to the control constructor and if `setTarget` is not called - * then the control is added to the map's overlay container. - * @param {Element|string} target Target. - * @api - */ + * This function is used to set a target element for the control. It has no + * effect if it is called after the control has been added to the map (i.e. + * after `setMap` is called on the control). If no `target` is set in the + * options passed to the control constructor and if `setTarget` is not called + * then the control is added to the map's overlay container. + * @param {Element|string} target Target. + * @api + */ setTarget(target) { this.target_ = typeof target === 'string' ? document.getElementById(target) : diff --git a/src/ol/control/ZoomToExtent.js b/src/ol/control/ZoomToExtent.js index 01b230ee04..a73951a026 100644 --- a/src/ol/control/ZoomToExtent.js +++ b/src/ol/control/ZoomToExtent.js @@ -36,9 +36,9 @@ class ZoomToExtent { const options = opt_options ? opt_options : {}; /** - * @type {module:ol/extent~Extent} - * @protected - */ + * @type {module:ol/extent~Extent} + * @protected + */ this.extent = options.extent ? options.extent : null; const className = options.className !== undefined ? options.className : 'ol-zoom-extent'; @@ -66,17 +66,17 @@ class ZoomToExtent { } /** - * @param {MouseEvent} event The event to handle - * @private - */ + * @param {MouseEvent} event The event to handle + * @private + */ handleClick_(event) { event.preventDefault(); this.handleZoomToExtent(); } /** - * @protected - */ + * @protected + */ handleZoomToExtent() { const map = this.getMap(); const view = map.getView(); diff --git a/src/ol/render/webgl/circlereplay/defaultshader/Locations.js b/src/ol/render/webgl/circlereplay/defaultshader/Locations.js index 1cd45a199c..a0c370e082 100644 --- a/src/ol/render/webgl/circlereplay/defaultshader/Locations.js +++ b/src/ol/render/webgl/circlereplay/defaultshader/Locations.js @@ -17,74 +17,74 @@ class Locations { constructor(gl, program) { /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_projectionMatrix = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'h'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_offsetScaleMatrix = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_offsetRotateMatrix = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_lineWidth = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_lineWidth' : 'k'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_pixelRatio = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_pixelRatio' : 'l'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_opacity = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_opacity' : 'm'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_fillColor = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_fillColor' : 'n'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_strokeColor = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_strokeColor' : 'o'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_size = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_size' : 'p'); /** - * @type {number} - */ + * @type {number} + */ this.a_position = gl.getAttribLocation( program, DEBUG_WEBGL ? 'a_position' : 'e'); /** - * @type {number} - */ + * @type {number} + */ this.a_instruction = gl.getAttribLocation( program, DEBUG_WEBGL ? 'a_instruction' : 'f'); /** - * @type {number} - */ + * @type {number} + */ this.a_radius = gl.getAttribLocation( program, DEBUG_WEBGL ? 'a_radius' : 'g'); diff --git a/src/ol/render/webgl/linestringreplay/defaultshader/Locations.js b/src/ol/render/webgl/linestringreplay/defaultshader/Locations.js index b1fc309e29..1b9a9f6c55 100644 --- a/src/ol/render/webgl/linestringreplay/defaultshader/Locations.js +++ b/src/ol/render/webgl/linestringreplay/defaultshader/Locations.js @@ -17,80 +17,80 @@ class Locations { constructor(gl, program) { /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_projectionMatrix = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'h'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_offsetScaleMatrix = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_offsetRotateMatrix = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_lineWidth = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_lineWidth' : 'k'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_miterLimit = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_miterLimit' : 'l'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_opacity = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_opacity' : 'm'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_color = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_color' : 'n'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_size = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_size' : 'o'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_pixelRatio = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_pixelRatio' : 'p'); /** - * @type {number} - */ + * @type {number} + */ this.a_lastPos = gl.getAttribLocation( program, DEBUG_WEBGL ? 'a_lastPos' : 'd'); /** - * @type {number} - */ + * @type {number} + */ this.a_position = gl.getAttribLocation( program, DEBUG_WEBGL ? 'a_position' : 'e'); /** - * @type {number} - */ + * @type {number} + */ this.a_nextPos = gl.getAttribLocation( program, DEBUG_WEBGL ? 'a_nextPos' : 'f'); /** - * @type {number} - */ + * @type {number} + */ this.a_direction = gl.getAttribLocation( program, DEBUG_WEBGL ? 'a_direction' : 'g'); diff --git a/src/ol/render/webgl/polygonreplay/defaultshader/Locations.js b/src/ol/render/webgl/polygonreplay/defaultshader/Locations.js index 5cb9960cd5..19482c6188 100644 --- a/src/ol/render/webgl/polygonreplay/defaultshader/Locations.js +++ b/src/ol/render/webgl/polygonreplay/defaultshader/Locations.js @@ -17,38 +17,38 @@ class Locations { constructor(gl, program) { /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_projectionMatrix = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'b'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_offsetScaleMatrix = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'c'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_offsetRotateMatrix = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'd'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_color = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_color' : 'e'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_opacity = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_opacity' : 'f'); /** - * @type {number} - */ + * @type {number} + */ this.a_position = gl.getAttribLocation( program, DEBUG_WEBGL ? 'a_position' : 'a'); diff --git a/src/ol/render/webgl/texturereplay/defaultshader/Locations.js b/src/ol/render/webgl/texturereplay/defaultshader/Locations.js index 90c99fb757..d8890f7c85 100644 --- a/src/ol/render/webgl/texturereplay/defaultshader/Locations.js +++ b/src/ol/render/webgl/texturereplay/defaultshader/Locations.js @@ -17,62 +17,62 @@ class Locations { constructor(gl, program) { /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_projectionMatrix = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'h'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_offsetScaleMatrix = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_offsetRotateMatrix = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_opacity = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_opacity' : 'k'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_image = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_image' : 'l'); /** - * @type {number} - */ + * @type {number} + */ this.a_position = gl.getAttribLocation( program, DEBUG_WEBGL ? 'a_position' : 'c'); /** - * @type {number} - */ + * @type {number} + */ this.a_texCoord = gl.getAttribLocation( program, DEBUG_WEBGL ? 'a_texCoord' : 'd'); /** - * @type {number} - */ + * @type {number} + */ this.a_offsets = gl.getAttribLocation( program, DEBUG_WEBGL ? 'a_offsets' : 'e'); /** - * @type {number} - */ + * @type {number} + */ this.a_opacity = gl.getAttribLocation( program, DEBUG_WEBGL ? 'a_opacity' : 'f'); /** - * @type {number} - */ + * @type {number} + */ this.a_rotateWithView = gl.getAttribLocation( program, DEBUG_WEBGL ? 'a_rotateWithView' : 'g'); diff --git a/src/ol/renderer/webgl/defaultmapshader/Locations.js b/src/ol/renderer/webgl/defaultmapshader/Locations.js index 0ac95de300..229f3ba4a4 100644 --- a/src/ol/renderer/webgl/defaultmapshader/Locations.js +++ b/src/ol/renderer/webgl/defaultmapshader/Locations.js @@ -17,38 +17,38 @@ class Locations { constructor(gl, program) { /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_texCoordMatrix = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_texCoordMatrix' : 'd'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_projectionMatrix = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'e'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_opacity = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_opacity' : 'f'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_texture = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_texture' : 'g'); /** - * @type {number} - */ + * @type {number} + */ this.a_position = gl.getAttribLocation( program, DEBUG_WEBGL ? 'a_position' : 'b'); /** - * @type {number} - */ + * @type {number} + */ this.a_texCoord = gl.getAttribLocation( program, DEBUG_WEBGL ? 'a_texCoord' : 'c'); diff --git a/src/ol/renderer/webgl/tilelayershader/Locations.js b/src/ol/renderer/webgl/tilelayershader/Locations.js index 8560c438e2..0b87535cfc 100644 --- a/src/ol/renderer/webgl/tilelayershader/Locations.js +++ b/src/ol/renderer/webgl/tilelayershader/Locations.js @@ -17,26 +17,26 @@ class Locations { constructor(gl, program) { /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_tileOffset = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_tileOffset' : 'd'); /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.u_texture = gl.getUniformLocation( program, DEBUG_WEBGL ? 'u_texture' : 'e'); /** - * @type {number} - */ + * @type {number} + */ this.a_position = gl.getAttribLocation( program, DEBUG_WEBGL ? 'a_position' : 'b'); /** - * @type {number} - */ + * @type {number} + */ this.a_texCoord = gl.getAttribLocation( program, DEBUG_WEBGL ? 'a_texCoord' : 'c'); diff --git a/src/ol/webgl/shaderlocations.mustache b/src/ol/webgl/shaderlocations.mustache index aec7cddff5..988cac4126 100644 --- a/src/ol/webgl/shaderlocations.mustache +++ b/src/ol/webgl/shaderlocations.mustache @@ -18,16 +18,16 @@ class Locations { {{#uniforms}} /** - * @type {WebGLUniformLocation} - */ + * @type {WebGLUniformLocation} + */ this.{{originalName}} = gl.getUniformLocation( program, DEBUG_WEBGL ? '{{originalName}}' : '{{shortName}}'); {{/uniforms}} {{#attributes}} /** - * @type {number} - */ + * @type {number} + */ this.{{originalName}} = gl.getAttribLocation( program, DEBUG_WEBGL ? '{{originalName}}' : '{{shortName}}'); {{/attributes}}