Fix comments indentation

This commit is contained in:
Frederic Junod
2018-07-17 09:12:50 +02:00
parent d0ab8dce38
commit 7e3e0e54ca
17 changed files with 412 additions and 412 deletions

View File

@@ -9,8 +9,8 @@ import {UNDEFINED} from './functions.js';
*/ */
class Disposable { class Disposable {
/** /**
* Clean up. * Clean up.
*/ */
dispose() { dispose() {
if (!this.disposed_) { if (!this.disposed_) {
this.disposed_ = true; this.disposed_ = true;

View File

@@ -44,53 +44,53 @@ class ImageWrapper {
ImageBase.call(this, extent, resolution, pixelRatio, ImageState.IDLE); ImageBase.call(this, extent, resolution, pixelRatio, ImageState.IDLE);
/** /**
* @private * @private
* @type {string} * @type {string}
*/ */
this.src_ = src; this.src_ = src;
/** /**
* @private * @private
* @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} * @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement}
*/ */
this.image_ = new Image(); this.image_ = new Image();
if (crossOrigin !== null) { if (crossOrigin !== null) {
this.image_.crossOrigin = crossOrigin; this.image_.crossOrigin = crossOrigin;
} }
/** /**
* @private * @private
* @type {Array.<module:ol/events~EventsKey>} * @type {Array.<module:ol/events~EventsKey>}
*/ */
this.imageListenerKeys_ = null; this.imageListenerKeys_ = null;
/** /**
* @protected * @protected
* @type {module:ol/ImageState} * @type {module:ol/ImageState}
*/ */
this.state = ImageState.IDLE; this.state = ImageState.IDLE;
/** /**
* @private * @private
* @type {module:ol/Image~LoadFunction} * @type {module:ol/Image~LoadFunction}
*/ */
this.imageLoadFunction_ = imageLoadFunction; this.imageLoadFunction_ = imageLoadFunction;
} }
/** /**
* @inheritDoc * @inheritDoc
* @api * @api
*/ */
getImage() { getImage() {
return this.image_; return this.image_;
} }
/** /**
* Tracks loading or read errors. * Tracks loading or read errors.
* *
* @private * @private
*/ */
handleImageError_() { handleImageError_() {
this.state = ImageState.ERROR; this.state = ImageState.ERROR;
this.unlistenImage_(); this.unlistenImage_();
@@ -98,10 +98,10 @@ class ImageWrapper {
} }
/** /**
* Tracks successful image load. * Tracks successful image load.
* *
* @private * @private
*/ */
handleImageLoad_() { handleImageLoad_() {
if (this.resolution === undefined) { if (this.resolution === undefined) {
this.resolution = getHeight(this.extent) / this.image_.height; this.resolution = getHeight(this.extent) / this.image_.height;
@@ -112,38 +112,38 @@ class ImageWrapper {
} }
/** /**
* Load the image or retry if loading previously failed. * Load the image or retry if loading previously failed.
* Loading is taken care of by the tile queue, and calling this method is * 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. * only needed for preloading or for reloading in case of an error.
* @override * @override
* @api * @api
*/ */
load() { load() {
if (this.state == ImageState.IDLE || this.state == ImageState.ERROR) { if (this.state == ImageState.IDLE || this.state == ImageState.ERROR) {
this.state = ImageState.LOADING; this.state = ImageState.LOADING;
this.changed(); this.changed();
this.imageListenerKeys_ = [ this.imageListenerKeys_ = [
listenOnce(this.image_, EventType.ERROR, listenOnce(this.image_, EventType.ERROR,
this.handleImageError_, this), this.handleImageError_, this),
listenOnce(this.image_, EventType.LOAD, listenOnce(this.image_, EventType.LOAD,
this.handleImageLoad_, this) this.handleImageLoad_, this)
]; ];
this.imageLoadFunction_(this, this.src_); this.imageLoadFunction_(this, this.src_);
} }
} }
/** /**
* @param {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} image Image. * @param {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} image Image.
*/ */
setImage(image) { setImage(image) {
this.image_ = image; this.image_ = image;
} }
/** /**
* Discards event handlers which listen for load completion or errors. * Discards event handlers which listen for load completion or errors.
* *
* @private * @private
*/ */
unlistenImage_() { unlistenImage_() {
this.imageListenerKeys_.forEach(unlistenByKey); this.imageListenerKeys_.forEach(unlistenByKey);
this.imageListenerKeys_ = null; this.imageListenerKeys_ = null;

View File

@@ -20,76 +20,76 @@ class ImageBase {
EventTarget.call(this); EventTarget.call(this);
/** /**
* @protected * @protected
* @type {module:ol/extent~Extent} * @type {module:ol/extent~Extent}
*/ */
this.extent = extent; this.extent = extent;
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.pixelRatio_ = pixelRatio; this.pixelRatio_ = pixelRatio;
/** /**
* @protected * @protected
* @type {number|undefined} * @type {number|undefined}
*/ */
this.resolution = resolution; this.resolution = resolution;
/** /**
* @protected * @protected
* @type {module:ol/ImageState} * @type {module:ol/ImageState}
*/ */
this.state = state; this.state = state;
} }
/** /**
* @protected * @protected
*/ */
changed() { changed() {
this.dispatchEvent(EventType.CHANGE); this.dispatchEvent(EventType.CHANGE);
} }
/** /**
* @return {module:ol/extent~Extent} Extent. * @return {module:ol/extent~Extent} Extent.
*/ */
getExtent() { getExtent() {
return this.extent; return this.extent;
} }
/** /**
* @abstract * @abstract
* @return {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} Image. * @return {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} Image.
*/ */
getImage() {} getImage() {}
/** /**
* @return {number} PixelRatio. * @return {number} PixelRatio.
*/ */
getPixelRatio() { getPixelRatio() {
return this.pixelRatio_; return this.pixelRatio_;
} }
/** /**
* @return {number} Resolution. * @return {number} Resolution.
*/ */
getResolution() { getResolution() {
return /** @type {number} */ (this.resolution); return /** @type {number} */ (this.resolution);
} }
/** /**
* @return {module:ol/ImageState} State. * @return {module:ol/ImageState} State.
*/ */
getState() { getState() {
return this.state; return this.state;
} }
/** /**
* Load not yet loaded URI. * Load not yet loaded URI.
* @abstract * @abstract
*/ */
load() {} load() {}
} }

View File

@@ -30,10 +30,10 @@ class ImageCanvas {
constructor(extent, resolution, pixelRatio, canvas, opt_loader) { constructor(extent, resolution, pixelRatio, canvas, opt_loader) {
/** /**
* Optional canvas loader function. * Optional canvas loader function.
* @type {?module:ol/ImageCanvas~Loader} * @type {?module:ol/ImageCanvas~Loader}
* @private * @private
*/ */
this.loader_ = opt_loader !== undefined ? opt_loader : null; this.loader_ = opt_loader !== undefined ? opt_loader : null;
const state = opt_loader !== undefined ? ImageState.IDLE : ImageState.LOADED; const state = opt_loader !== undefined ? ImageState.IDLE : ImageState.LOADED;
@@ -41,32 +41,32 @@ class ImageCanvas {
ImageBase.call(this, extent, resolution, pixelRatio, state); ImageBase.call(this, extent, resolution, pixelRatio, state);
/** /**
* @private * @private
* @type {HTMLCanvasElement} * @type {HTMLCanvasElement}
*/ */
this.canvas_ = canvas; this.canvas_ = canvas;
/** /**
* @private * @private
* @type {Error} * @type {Error}
*/ */
this.error_ = null; this.error_ = null;
} }
/** /**
* Get any error associated with asynchronous rendering. * Get any error associated with asynchronous rendering.
* @return {Error} Any error that occurred during rendering. * @return {Error} Any error that occurred during rendering.
*/ */
getError() { getError() {
return this.error_; return this.error_;
} }
/** /**
* Handle async drawing complete. * Handle async drawing complete.
* @param {Error} err Any error during drawing. * @param {Error} err Any error during drawing.
* @private * @private
*/ */
handleLoad_(err) { handleLoad_(err) {
if (err) { if (err) {
this.error_ = err; this.error_ = err;
@@ -78,8 +78,8 @@ class ImageCanvas {
} }
/** /**
* @inheritDoc * @inheritDoc
*/ */
load() { load() {
if (this.state == ImageState.IDLE) { if (this.state == ImageState.IDLE) {
this.state = ImageState.LOADING; this.state = ImageState.LOADING;
@@ -89,8 +89,8 @@ class ImageCanvas {
} }
/** /**
* @return {HTMLCanvasElement} Canvas element. * @return {HTMLCanvasElement} Canvas element.
*/ */
getImage() { getImage() {
return this.canvas_; return this.canvas_;
} }

View File

@@ -18,45 +18,45 @@ class Kinetic {
constructor(decay, minVelocity, delay) { constructor(decay, minVelocity, delay) {
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.decay_ = decay; this.decay_ = decay;
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.minVelocity_ = minVelocity; this.minVelocity_ = minVelocity;
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.delay_ = delay; this.delay_ = delay;
/** /**
* @private * @private
* @type {Array.<number>} * @type {Array.<number>}
*/ */
this.points_ = []; this.points_ = [];
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.angle_ = 0; this.angle_ = 0;
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.initialVelocity_ = 0; this.initialVelocity_ = 0;
} }
/** /**
* FIXME empty description for jsdoc * FIXME empty description for jsdoc
*/ */
begin() { begin() {
this.points_.length = 0; this.points_.length = 0;
this.angle_ = 0; this.angle_ = 0;
@@ -64,16 +64,16 @@ class Kinetic {
} }
/** /**
* @param {number} x X. * @param {number} x X.
* @param {number} y Y. * @param {number} y Y.
*/ */
update(x, y) { update(x, y) {
this.points_.push(x, y, Date.now()); this.points_.push(x, y, Date.now());
} }
/** /**
* @return {boolean} Whether we should do kinetic animation. * @return {boolean} Whether we should do kinetic animation.
*/ */
end() { end() {
if (this.points_.length < 6) { if (this.points_.length < 6) {
// at least 2 points are required (i.e. there must be at least 6 elements // 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() { getDistance() {
return (this.minVelocity_ - this.initialVelocity_) / this.decay_; 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() { getAngle() {
return this.angle_; return this.angle_;
} }

View File

@@ -23,55 +23,55 @@ class MapBrowserEvent {
MapEvent.call(this, type, map, opt_frameState); MapEvent.call(this, type, map, opt_frameState);
/** /**
* The original browser event. * The original browser event.
* @const * @const
* @type {Event} * @type {Event}
* @api * @api
*/ */
this.originalEvent = browserEvent; this.originalEvent = browserEvent;
/** /**
* The map pixel relative to the viewport corresponding to the original browser event. * The map pixel relative to the viewport corresponding to the original browser event.
* @type {module:ol~Pixel} * @type {module:ol~Pixel}
* @api * @api
*/ */
this.pixel = map.getEventPixel(browserEvent); this.pixel = map.getEventPixel(browserEvent);
/** /**
* The coordinate in view projection corresponding to the original browser event. * The coordinate in view projection corresponding to the original browser event.
* @type {module:ol/coordinate~Coordinate} * @type {module:ol/coordinate~Coordinate}
* @api * @api
*/ */
this.coordinate = map.getCoordinateFromPixel(this.pixel); this.coordinate = map.getCoordinateFromPixel(this.pixel);
/** /**
* Indicates if the map is currently being dragged. Only set for * Indicates if the map is currently being dragged. Only set for
* `POINTERDRAG` and `POINTERMOVE` events. Default is `false`. * `POINTERDRAG` and `POINTERMOVE` events. Default is `false`.
* *
* @type {boolean} * @type {boolean}
* @api * @api
*/ */
this.dragging = opt_dragging !== undefined ? opt_dragging : false; this.dragging = opt_dragging !== undefined ? opt_dragging : false;
} }
/** /**
* Prevents the default browser action. * Prevents the default browser action.
* @see https://developer.mozilla.org/en-US/docs/Web/API/event.preventDefault * @see https://developer.mozilla.org/en-US/docs/Web/API/event.preventDefault
* @override * @override
* @api * @api
*/ */
preventDefault() { preventDefault() {
MapEvent.prototype.preventDefault.call(this); MapEvent.prototype.preventDefault.call(this);
this.originalEvent.preventDefault(); this.originalEvent.preventDefault();
} }
/** /**
* Prevents further propagation of the current event. * Prevents further propagation of the current event.
* @see https://developer.mozilla.org/en-US/docs/Web/API/event.stopPropagation * @see https://developer.mozilla.org/en-US/docs/Web/API/event.stopPropagation
* @override * @override
* @api * @api
*/ */
stopPropagation() { stopPropagation() {
MapEvent.prototype.stopPropagation.call(this); MapEvent.prototype.stopPropagation.call(this);
this.originalEvent.stopPropagation(); this.originalEvent.stopPropagation();

View File

@@ -16,65 +16,65 @@ class TileRange {
constructor(minX, maxX, minY, maxY) { constructor(minX, maxX, minY, maxY) {
/** /**
* @type {number} * @type {number}
*/ */
this.minX = minX; this.minX = minX;
/** /**
* @type {number} * @type {number}
*/ */
this.maxX = maxX; this.maxX = maxX;
/** /**
* @type {number} * @type {number}
*/ */
this.minY = minY; this.minY = minY;
/** /**
* @type {number} * @type {number}
*/ */
this.maxY = maxY; this.maxY = maxY;
} }
/** /**
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate. * @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
* @return {boolean} Contains tile coordinate. * @return {boolean} Contains tile coordinate.
*/ */
contains(tileCoord) { contains(tileCoord) {
return this.containsXY(tileCoord[1], tileCoord[2]); return this.containsXY(tileCoord[1], tileCoord[2]);
} }
/** /**
* @param {module:ol/TileRange} tileRange Tile range. * @param {module:ol/TileRange} tileRange Tile range.
* @return {boolean} Contains. * @return {boolean} Contains.
*/ */
containsTileRange(tileRange) { containsTileRange(tileRange) {
return this.minX <= tileRange.minX && tileRange.maxX <= this.maxX && return this.minX <= tileRange.minX && tileRange.maxX <= this.maxX &&
this.minY <= tileRange.minY && tileRange.maxY <= this.maxY; this.minY <= tileRange.minY && tileRange.maxY <= this.maxY;
} }
/** /**
* @param {number} x Tile coordinate x. * @param {number} x Tile coordinate x.
* @param {number} y Tile coordinate y. * @param {number} y Tile coordinate y.
* @return {boolean} Contains coordinate. * @return {boolean} Contains coordinate.
*/ */
containsXY(x, y) { containsXY(x, y) {
return this.minX <= x && x <= this.maxX && this.minY <= y && y <= this.maxY; return this.minX <= x && x <= this.maxX && this.minY <= y && y <= this.maxY;
} }
/** /**
* @param {module:ol/TileRange} tileRange Tile range. * @param {module:ol/TileRange} tileRange Tile range.
* @return {boolean} Equals. * @return {boolean} Equals.
*/ */
equals(tileRange) { equals(tileRange) {
return this.minX == tileRange.minX && this.minY == tileRange.minY && return this.minX == tileRange.minX && this.minY == tileRange.minY &&
this.maxX == tileRange.maxX && this.maxY == tileRange.maxY; this.maxX == tileRange.maxX && this.maxY == tileRange.maxY;
} }
/** /**
* @param {module:ol/TileRange} tileRange Tile range. * @param {module:ol/TileRange} tileRange Tile range.
*/ */
extend(tileRange) { extend(tileRange) {
if (tileRange.minX < this.minX) { if (tileRange.minX < this.minX) {
this.minX = tileRange.minX; this.minX = tileRange.minX;

View File

@@ -34,64 +34,64 @@ class VectorTile {
Tile.call(this, tileCoord, state, opt_options); Tile.call(this, tileCoord, state, opt_options);
/** /**
* @type {number} * @type {number}
*/ */
this.consumers = 0; this.consumers = 0;
/** /**
* @private * @private
* @type {module:ol/extent~Extent} * @type {module:ol/extent~Extent}
*/ */
this.extent_ = null; this.extent_ = null;
/** /**
* @private * @private
* @type {module:ol/format/Feature} * @type {module:ol/format/Feature}
*/ */
this.format_ = format; this.format_ = format;
/** /**
* @private * @private
* @type {Array.<module:ol/Feature>} * @type {Array.<module:ol/Feature>}
*/ */
this.features_ = null; this.features_ = null;
/** /**
* @private * @private
* @type {module:ol/featureloader~FeatureLoader} * @type {module:ol/featureloader~FeatureLoader}
*/ */
this.loader_; this.loader_;
/** /**
* Data projection * Data projection
* @private * @private
* @type {module:ol/proj/Projection} * @type {module:ol/proj/Projection}
*/ */
this.projection_ = null; this.projection_ = null;
/** /**
* @private * @private
* @type {Object.<string, module:ol/render/ReplayGroup>} * @type {Object.<string, module:ol/render/ReplayGroup>}
*/ */
this.replayGroups_ = {}; this.replayGroups_ = {};
/** /**
* @private * @private
* @type {module:ol/Tile~LoadFunction} * @type {module:ol/Tile~LoadFunction}
*/ */
this.tileLoadFunction_ = tileLoadFunction; this.tileLoadFunction_ = tileLoadFunction;
/** /**
* @private * @private
* @type {string} * @type {string}
*/ */
this.url_ = src; this.url_ = src;
} }
/** /**
* @inheritDoc * @inheritDoc
*/ */
disposeInternal() { disposeInternal() {
this.features_ = null; this.features_ = null;
this.replayGroups_ = {}; this.replayGroups_ = {};
@@ -101,62 +101,62 @@ class VectorTile {
} }
/** /**
* Gets the extent of the vector tile. * Gets the extent of the vector tile.
* @return {module:ol/extent~Extent} The extent. * @return {module:ol/extent~Extent} The extent.
* @api * @api
*/ */
getExtent() { getExtent() {
return this.extent_ || DEFAULT_EXTENT; return this.extent_ || DEFAULT_EXTENT;
} }
/** /**
* Get the feature format assigned for reading this tile's features. * Get the feature format assigned for reading this tile's features.
* @return {module:ol/format/Feature} Feature format. * @return {module:ol/format/Feature} Feature format.
* @api * @api
*/ */
getFormat() { getFormat() {
return this.format_; return this.format_;
} }
/** /**
* Get the features for this tile. Geometries will be in the projection returned * Get the features for this tile. Geometries will be in the projection returned
* by {@link module:ol/VectorTile~VectorTile#getProjection}. * by {@link module:ol/VectorTile~VectorTile#getProjection}.
* @return {Array.<module:ol/Feature|module:ol/render/Feature>} Features. * @return {Array.<module:ol/Feature|module:ol/render/Feature>} Features.
* @api * @api
*/ */
getFeatures() { getFeatures() {
return this.features_; return this.features_;
} }
/** /**
* @inheritDoc * @inheritDoc
*/ */
getKey() { getKey() {
return this.url_; return this.url_;
} }
/** /**
* Get the feature projection of features returned by * Get the feature projection of features returned by
* {@link module:ol/VectorTile~VectorTile#getFeatures}. * {@link module:ol/VectorTile~VectorTile#getFeatures}.
* @return {module:ol/proj/Projection} Feature projection. * @return {module:ol/proj/Projection} Feature projection.
* @api * @api
*/ */
getProjection() { getProjection() {
return this.projection_; return this.projection_;
} }
/** /**
* @param {module:ol/layer/Layer} layer Layer. * @param {module:ol/layer/Layer} layer Layer.
* @param {string} key Key. * @param {string} key Key.
* @return {module:ol/render/ReplayGroup} Replay group. * @return {module:ol/render/ReplayGroup} Replay group.
*/ */
getReplayGroup(layer, key) { getReplayGroup(layer, key) {
return this.replayGroups_[getUid(layer) + ',' + key]; return this.replayGroups_[getUid(layer) + ',' + key];
} }
/** /**
* @inheritDoc * @inheritDoc
*/ */
load() { load() {
if (this.state == TileState.IDLE) { if (this.state == TileState.IDLE) {
this.setState(TileState.LOADING); this.setState(TileState.LOADING);
@@ -166,11 +166,11 @@ class VectorTile {
} }
/** /**
* Handler for successful tile load. * Handler for successful tile load.
* @param {Array.<module:ol/Feature>} features The loaded features. * @param {Array.<module:ol/Feature>} features The loaded features.
* @param {module:ol/proj/Projection} dataProjection Data projection. * @param {module:ol/proj/Projection} dataProjection Data projection.
* @param {module:ol/extent~Extent} extent Extent. * @param {module:ol/extent~Extent} extent Extent.
*/ */
onLoad(features, dataProjection, extent) { onLoad(features, dataProjection, extent) {
this.setProjection(dataProjection); this.setProjection(dataProjection);
this.setFeatures(features); this.setFeatures(features);
@@ -178,64 +178,64 @@ class VectorTile {
} }
/** /**
* Handler for tile load errors. * Handler for tile load errors.
*/ */
onError() { onError() {
this.setState(TileState.ERROR); this.setState(TileState.ERROR);
} }
/** /**
* Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s * Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s
* `tileLoadFunction`. Sets the extent of the vector tile. This is only required * `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 * for tiles in projections with `tile-pixels` as units. The extent should be
* set to `[0, 0, tilePixelSize, tilePixelSize]`, where `tilePixelSize` is * set to `[0, 0, tilePixelSize, tilePixelSize]`, where `tilePixelSize` is
* calculated by multiplying the tile size with the tile pixel ratio. For * calculated by multiplying the tile size with the tile pixel ratio. For
* sources using {@link module:ol/format/MVT~MVT} as feature format, the * sources using {@link module:ol/format/MVT~MVT} as feature format, the
* {@link module:ol/format/MVT~MVT#getLastExtent} method will return the correct * {@link module:ol/format/MVT~MVT#getLastExtent} method will return the correct
* extent. The default is `[0, 0, 4096, 4096]`. * extent. The default is `[0, 0, 4096, 4096]`.
* @param {module:ol/extent~Extent} extent The extent. * @param {module:ol/extent~Extent} extent The extent.
* @api * @api
*/ */
setExtent(extent) { setExtent(extent) {
this.extent_ = extent; this.extent_ = extent;
} }
/** /**
* Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`. * Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`.
* Sets the features for the tile. * Sets the features for the tile.
* @param {Array.<module:ol/Feature>} features Features. * @param {Array.<module:ol/Feature>} features Features.
* @api * @api
*/ */
setFeatures(features) { setFeatures(features) {
this.features_ = features; this.features_ = features;
this.setState(TileState.LOADED); this.setState(TileState.LOADED);
} }
/** /**
* Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`. * Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`.
* Sets the projection of the features that were added with * Sets the projection of the features that were added with
* {@link module:ol/VectorTile~VectorTile#setFeatures}. * {@link module:ol/VectorTile~VectorTile#setFeatures}.
* @param {module:ol/proj/Projection} projection Feature projection. * @param {module:ol/proj/Projection} projection Feature projection.
* @api * @api
*/ */
setProjection(projection) { setProjection(projection) {
this.projection_ = projection; this.projection_ = projection;
} }
/** /**
* @param {module:ol/layer/Layer} layer Layer. * @param {module:ol/layer/Layer} layer Layer.
* @param {string} key Key. * @param {string} key Key.
* @param {module:ol/render/ReplayGroup} replayGroup Replay group. * @param {module:ol/render/ReplayGroup} replayGroup Replay group.
*/ */
setReplayGroup(layer, key, replayGroup) { setReplayGroup(layer, key, replayGroup) {
this.replayGroups_[getUid(layer) + ',' + key] = replayGroup; this.replayGroups_[getUid(layer) + ',' + key] = replayGroup;
} }
/** /**
* Set the feature loader for reading this tile's features. * Set the feature loader for reading this tile's features.
* @param {module:ol/featureloader~FeatureLoader} loader Feature loader. * @param {module:ol/featureloader~FeatureLoader} loader Feature loader.
* @api * @api
*/ */
setLoader(loader) { setLoader(loader) {
this.loader_ = loader; this.loader_ = loader;
} }

View File

@@ -55,32 +55,32 @@ class Control {
BaseObject.call(this); BaseObject.call(this);
/** /**
* @protected * @protected
* @type {Element} * @type {Element}
*/ */
this.element = options.element ? options.element : null; this.element = options.element ? options.element : null;
/** /**
* @private * @private
* @type {Element} * @type {Element}
*/ */
this.target_ = null; this.target_ = null;
/** /**
* @private * @private
* @type {module:ol/PluggableMap} * @type {module:ol/PluggableMap}
*/ */
this.map_ = null; this.map_ = null;
/** /**
* @protected * @protected
* @type {!Array.<module:ol/events~EventsKey>} * @type {!Array.<module:ol/events~EventsKey>}
*/ */
this.listenerKeys = []; this.listenerKeys = [];
/** /**
* @type {function(module:ol/MapEvent)} * @type {function(module:ol/MapEvent)}
*/ */
this.render = options.render ? options.render : UNDEFINED; this.render = options.render ? options.render : UNDEFINED;
if (options.target) { if (options.target) {
@@ -90,29 +90,29 @@ class Control {
} }
/** /**
* @inheritDoc * @inheritDoc
*/ */
disposeInternal() { disposeInternal() {
removeNode(this.element); removeNode(this.element);
BaseObject.prototype.disposeInternal.call(this); BaseObject.prototype.disposeInternal.call(this);
} }
/** /**
* Get the map associated with this control. * Get the map associated with this control.
* @return {module:ol/PluggableMap} Map. * @return {module:ol/PluggableMap} Map.
* @api * @api
*/ */
getMap() { getMap() {
return this.map_; return this.map_;
} }
/** /**
* Remove the control from its current map and attach it to the new 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 * Subclasses may set up event handlers to get notified about changes to
* the map here. * the map here.
* @param {module:ol/PluggableMap} map Map. * @param {module:ol/PluggableMap} map Map.
* @api * @api
*/ */
setMap(map) { setMap(map) {
if (this.map_) { if (this.map_) {
removeNode(this.element); removeNode(this.element);
@@ -135,14 +135,14 @@ class Control {
} }
/** /**
* This function is used to set a target element for the control. It has no * 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. * 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 * 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 * options passed to the control constructor and if `setTarget` is not called
* then the control is added to the map's overlay container. * then the control is added to the map's overlay container.
* @param {Element|string} target Target. * @param {Element|string} target Target.
* @api * @api
*/ */
setTarget(target) { setTarget(target) {
this.target_ = typeof target === 'string' ? this.target_ = typeof target === 'string' ?
document.getElementById(target) : document.getElementById(target) :

View File

@@ -36,9 +36,9 @@ class ZoomToExtent {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};
/** /**
* @type {module:ol/extent~Extent} * @type {module:ol/extent~Extent}
* @protected * @protected
*/ */
this.extent = options.extent ? options.extent : null; this.extent = options.extent ? options.extent : null;
const className = options.className !== undefined ? options.className : 'ol-zoom-extent'; const className = options.className !== undefined ? options.className : 'ol-zoom-extent';
@@ -66,17 +66,17 @@ class ZoomToExtent {
} }
/** /**
* @param {MouseEvent} event The event to handle * @param {MouseEvent} event The event to handle
* @private * @private
*/ */
handleClick_(event) { handleClick_(event) {
event.preventDefault(); event.preventDefault();
this.handleZoomToExtent(); this.handleZoomToExtent();
} }
/** /**
* @protected * @protected
*/ */
handleZoomToExtent() { handleZoomToExtent() {
const map = this.getMap(); const map = this.getMap();
const view = map.getView(); const view = map.getView();

View File

@@ -17,74 +17,74 @@ class Locations {
constructor(gl, program) { constructor(gl, program) {
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_projectionMatrix = gl.getUniformLocation( this.u_projectionMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'h'); program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'h');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_offsetScaleMatrix = gl.getUniformLocation( this.u_offsetScaleMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i'); program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_offsetRotateMatrix = gl.getUniformLocation( this.u_offsetRotateMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j'); program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_lineWidth = gl.getUniformLocation( this.u_lineWidth = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_lineWidth' : 'k'); program, DEBUG_WEBGL ? 'u_lineWidth' : 'k');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_pixelRatio = gl.getUniformLocation( this.u_pixelRatio = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_pixelRatio' : 'l'); program, DEBUG_WEBGL ? 'u_pixelRatio' : 'l');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_opacity = gl.getUniformLocation( this.u_opacity = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_opacity' : 'm'); program, DEBUG_WEBGL ? 'u_opacity' : 'm');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_fillColor = gl.getUniformLocation( this.u_fillColor = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_fillColor' : 'n'); program, DEBUG_WEBGL ? 'u_fillColor' : 'n');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_strokeColor = gl.getUniformLocation( this.u_strokeColor = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_strokeColor' : 'o'); program, DEBUG_WEBGL ? 'u_strokeColor' : 'o');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_size = gl.getUniformLocation( this.u_size = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_size' : 'p'); program, DEBUG_WEBGL ? 'u_size' : 'p');
/** /**
* @type {number} * @type {number}
*/ */
this.a_position = gl.getAttribLocation( this.a_position = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_position' : 'e'); program, DEBUG_WEBGL ? 'a_position' : 'e');
/** /**
* @type {number} * @type {number}
*/ */
this.a_instruction = gl.getAttribLocation( this.a_instruction = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_instruction' : 'f'); program, DEBUG_WEBGL ? 'a_instruction' : 'f');
/** /**
* @type {number} * @type {number}
*/ */
this.a_radius = gl.getAttribLocation( this.a_radius = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_radius' : 'g'); program, DEBUG_WEBGL ? 'a_radius' : 'g');

View File

@@ -17,80 +17,80 @@ class Locations {
constructor(gl, program) { constructor(gl, program) {
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_projectionMatrix = gl.getUniformLocation( this.u_projectionMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'h'); program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'h');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_offsetScaleMatrix = gl.getUniformLocation( this.u_offsetScaleMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i'); program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_offsetRotateMatrix = gl.getUniformLocation( this.u_offsetRotateMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j'); program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_lineWidth = gl.getUniformLocation( this.u_lineWidth = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_lineWidth' : 'k'); program, DEBUG_WEBGL ? 'u_lineWidth' : 'k');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_miterLimit = gl.getUniformLocation( this.u_miterLimit = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_miterLimit' : 'l'); program, DEBUG_WEBGL ? 'u_miterLimit' : 'l');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_opacity = gl.getUniformLocation( this.u_opacity = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_opacity' : 'm'); program, DEBUG_WEBGL ? 'u_opacity' : 'm');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_color = gl.getUniformLocation( this.u_color = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_color' : 'n'); program, DEBUG_WEBGL ? 'u_color' : 'n');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_size = gl.getUniformLocation( this.u_size = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_size' : 'o'); program, DEBUG_WEBGL ? 'u_size' : 'o');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_pixelRatio = gl.getUniformLocation( this.u_pixelRatio = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_pixelRatio' : 'p'); program, DEBUG_WEBGL ? 'u_pixelRatio' : 'p');
/** /**
* @type {number} * @type {number}
*/ */
this.a_lastPos = gl.getAttribLocation( this.a_lastPos = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_lastPos' : 'd'); program, DEBUG_WEBGL ? 'a_lastPos' : 'd');
/** /**
* @type {number} * @type {number}
*/ */
this.a_position = gl.getAttribLocation( this.a_position = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_position' : 'e'); program, DEBUG_WEBGL ? 'a_position' : 'e');
/** /**
* @type {number} * @type {number}
*/ */
this.a_nextPos = gl.getAttribLocation( this.a_nextPos = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_nextPos' : 'f'); program, DEBUG_WEBGL ? 'a_nextPos' : 'f');
/** /**
* @type {number} * @type {number}
*/ */
this.a_direction = gl.getAttribLocation( this.a_direction = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_direction' : 'g'); program, DEBUG_WEBGL ? 'a_direction' : 'g');

View File

@@ -17,38 +17,38 @@ class Locations {
constructor(gl, program) { constructor(gl, program) {
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_projectionMatrix = gl.getUniformLocation( this.u_projectionMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'b'); program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'b');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_offsetScaleMatrix = gl.getUniformLocation( this.u_offsetScaleMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'c'); program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'c');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_offsetRotateMatrix = gl.getUniformLocation( this.u_offsetRotateMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'd'); program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'd');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_color = gl.getUniformLocation( this.u_color = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_color' : 'e'); program, DEBUG_WEBGL ? 'u_color' : 'e');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_opacity = gl.getUniformLocation( this.u_opacity = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_opacity' : 'f'); program, DEBUG_WEBGL ? 'u_opacity' : 'f');
/** /**
* @type {number} * @type {number}
*/ */
this.a_position = gl.getAttribLocation( this.a_position = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_position' : 'a'); program, DEBUG_WEBGL ? 'a_position' : 'a');

View File

@@ -17,62 +17,62 @@ class Locations {
constructor(gl, program) { constructor(gl, program) {
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_projectionMatrix = gl.getUniformLocation( this.u_projectionMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'h'); program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'h');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_offsetScaleMatrix = gl.getUniformLocation( this.u_offsetScaleMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i'); program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_offsetRotateMatrix = gl.getUniformLocation( this.u_offsetRotateMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j'); program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_opacity = gl.getUniformLocation( this.u_opacity = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_opacity' : 'k'); program, DEBUG_WEBGL ? 'u_opacity' : 'k');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_image = gl.getUniformLocation( this.u_image = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_image' : 'l'); program, DEBUG_WEBGL ? 'u_image' : 'l');
/** /**
* @type {number} * @type {number}
*/ */
this.a_position = gl.getAttribLocation( this.a_position = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_position' : 'c'); program, DEBUG_WEBGL ? 'a_position' : 'c');
/** /**
* @type {number} * @type {number}
*/ */
this.a_texCoord = gl.getAttribLocation( this.a_texCoord = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_texCoord' : 'd'); program, DEBUG_WEBGL ? 'a_texCoord' : 'd');
/** /**
* @type {number} * @type {number}
*/ */
this.a_offsets = gl.getAttribLocation( this.a_offsets = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_offsets' : 'e'); program, DEBUG_WEBGL ? 'a_offsets' : 'e');
/** /**
* @type {number} * @type {number}
*/ */
this.a_opacity = gl.getAttribLocation( this.a_opacity = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_opacity' : 'f'); program, DEBUG_WEBGL ? 'a_opacity' : 'f');
/** /**
* @type {number} * @type {number}
*/ */
this.a_rotateWithView = gl.getAttribLocation( this.a_rotateWithView = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_rotateWithView' : 'g'); program, DEBUG_WEBGL ? 'a_rotateWithView' : 'g');

View File

@@ -17,38 +17,38 @@ class Locations {
constructor(gl, program) { constructor(gl, program) {
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_texCoordMatrix = gl.getUniformLocation( this.u_texCoordMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_texCoordMatrix' : 'd'); program, DEBUG_WEBGL ? 'u_texCoordMatrix' : 'd');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_projectionMatrix = gl.getUniformLocation( this.u_projectionMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'e'); program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'e');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_opacity = gl.getUniformLocation( this.u_opacity = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_opacity' : 'f'); program, DEBUG_WEBGL ? 'u_opacity' : 'f');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_texture = gl.getUniformLocation( this.u_texture = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_texture' : 'g'); program, DEBUG_WEBGL ? 'u_texture' : 'g');
/** /**
* @type {number} * @type {number}
*/ */
this.a_position = gl.getAttribLocation( this.a_position = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_position' : 'b'); program, DEBUG_WEBGL ? 'a_position' : 'b');
/** /**
* @type {number} * @type {number}
*/ */
this.a_texCoord = gl.getAttribLocation( this.a_texCoord = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_texCoord' : 'c'); program, DEBUG_WEBGL ? 'a_texCoord' : 'c');

View File

@@ -17,26 +17,26 @@ class Locations {
constructor(gl, program) { constructor(gl, program) {
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_tileOffset = gl.getUniformLocation( this.u_tileOffset = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_tileOffset' : 'd'); program, DEBUG_WEBGL ? 'u_tileOffset' : 'd');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_texture = gl.getUniformLocation( this.u_texture = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_texture' : 'e'); program, DEBUG_WEBGL ? 'u_texture' : 'e');
/** /**
* @type {number} * @type {number}
*/ */
this.a_position = gl.getAttribLocation( this.a_position = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_position' : 'b'); program, DEBUG_WEBGL ? 'a_position' : 'b');
/** /**
* @type {number} * @type {number}
*/ */
this.a_texCoord = gl.getAttribLocation( this.a_texCoord = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_texCoord' : 'c'); program, DEBUG_WEBGL ? 'a_texCoord' : 'c');

View File

@@ -18,16 +18,16 @@ class Locations {
{{#uniforms}} {{#uniforms}}
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.{{originalName}} = gl.getUniformLocation( this.{{originalName}} = gl.getUniformLocation(
program, DEBUG_WEBGL ? '{{originalName}}' : '{{shortName}}'); program, DEBUG_WEBGL ? '{{originalName}}' : '{{shortName}}');
{{/uniforms}} {{/uniforms}}
{{#attributes}} {{#attributes}}
/** /**
* @type {number} * @type {number}
*/ */
this.{{originalName}} = gl.getAttribLocation( this.{{originalName}} = gl.getAttribLocation(
program, DEBUG_WEBGL ? '{{originalName}}' : '{{shortName}}'); program, DEBUG_WEBGL ? '{{originalName}}' : '{{shortName}}');
{{/attributes}} {{/attributes}}