diff --git a/src/ol/Collection.js b/src/ol/Collection.js index 6c15953019..ca2f80e5ad 100644 --- a/src/ol/Collection.js +++ b/src/ol/Collection.js @@ -56,6 +56,7 @@ export class CollectionEvent extends Event { * Collection; they trigger events on the appropriate object, not on the * Collection as a whole. * + * @template T * @api */ class Collection extends BaseObject { @@ -63,7 +64,6 @@ class Collection extends BaseObject { /** * @param {Array.=} opt_array Array. * @param {module:ol/Collection~Options=} opt_options Collection options. - * @template T */ constructor(opt_array, opt_options) { diff --git a/src/ol/Geolocation.js b/src/ol/Geolocation.js index 5f72759677..b096a10b44 100644 --- a/src/ol/Geolocation.js +++ b/src/ol/Geolocation.js @@ -15,7 +15,7 @@ import {get as getProjection, getTransformFromProjections, identityTransform} fr * @typedef {Object} Options * @property {boolean} [tracking=false] Start Tracking right after * instantiation. - * @property {GeolocationPositionOptions} [trackingOptions] Tracking options. + * @property {PositionOptions} [trackingOptions] Tracking options. * See {@link http://www.w3.org/TR/geolocation-API/#position_options_interface}. * @property {module:ol/proj~ProjectionLike} [projection] The projection the position * is reported in. @@ -135,7 +135,7 @@ class Geolocation extends BaseObject { /** * @private - * @param {GeolocationPosition} position position event. + * @param {Position} position position event. */ positionChange_(position) { const coords = position.coords; @@ -171,7 +171,7 @@ class Geolocation extends BaseObject { /** * @private - * @param {GeolocationPositionError} error error object. + * @param {PositionError} error error object. */ positionError_(error) { error.type = EventType.ERROR; @@ -286,14 +286,14 @@ class Geolocation extends BaseObject { /** * Get the tracking options. * @see http://www.w3.org/TR/geolocation-API/#position-options - * @return {GeolocationPositionOptions|undefined} PositionOptions as defined by + * @return {PositionOptions|undefined} PositionOptions as defined by * the [HTML5 Geolocation spec * ](http://www.w3.org/TR/geolocation-API/#position_options_interface). * @observable * @api */ getTrackingOptions() { - return /** @type {GeolocationPositionOptions|undefined} */ (this.get(GeolocationProperty.TRACKING_OPTIONS)); + return /** @type {PositionOptions|undefined} */ (this.get(GeolocationProperty.TRACKING_OPTIONS)); } /** @@ -320,7 +320,7 @@ class Geolocation extends BaseObject { /** * Set the tracking options. * @see http://www.w3.org/TR/geolocation-API/#position-options - * @param {GeolocationPositionOptions} options PositionOptions as defined by the + * @param {PositionOptions} options PositionOptions as defined by the * [HTML5 Geolocation spec * ](http://www.w3.org/TR/geolocation-API/#position_options_interface). * @observable diff --git a/src/ol/View.js b/src/ol/View.js index dfdf355f97..d635ac73a6 100644 --- a/src/ol/View.js +++ b/src/ol/View.js @@ -33,7 +33,7 @@ import Units from './proj/Units.js'; * @property {number} [sourceResolution] * @property {number} [targetResolution] * @property {number} [sourceRotation] - * @property {number} [sourceRotation] + * @property {number} [targetRotation] * @property {module:ol/coordinate~Coordinate} [anchor] * @property {number} start * @property {number} duration diff --git a/src/ol/control/Attribution.js b/src/ol/control/Attribution.js index 57d4d8922e..9b610883b1 100644 --- a/src/ol/control/Attribution.js +++ b/src/ol/control/Attribution.js @@ -13,7 +13,7 @@ import {visibleAtResolution} from '../layer/Layer.js'; /** * @typedef {Object} Options * @property {string} [className='ol-attribution'] CSS class name. - * @property {Element|string} [target] Specify a target if you + * @property {HTMLElement|string} [target] Specify a target if you * want the control to be rendered outside of the map's * viewport. * @property {boolean} [collapsible=true] Specify if attributions can @@ -25,7 +25,7 @@ import {visibleAtResolution} from '../layer/Layer.js'; * @property {string} [label='i'] Text label to use for the * collapsed attributions button. * Instead of text, also an element (e.g. a `span` element) can be used. - * @property {string|Element} [collapseLabel='»'] Text label to use + * @property {string|HTMLElement} [collapseLabel='»'] Text label to use * for the expanded attributions button. * Instead of text, also an element (e.g. a `span` element) can be used. * @property {function(module:ol/MapEvent)} [render] Function called when @@ -60,7 +60,7 @@ class Attribution extends Control { /** * @private - * @type {Element} + * @type {HTMLElement} */ this.ulElement_ = document.createElement('UL'); @@ -90,7 +90,7 @@ class Attribution extends Control { if (typeof collapseLabel === 'string') { /** * @private - * @type {Element} + * @type {HTMLElement} */ this.collapseLabel_ = document.createElement('span'); this.collapseLabel_.textContent = collapseLabel; @@ -103,7 +103,7 @@ class Attribution extends Control { if (typeof label === 'string') { /** * @private - * @type {Element} + * @type {HTMLElement} */ this.label_ = document.createElement('span'); this.label_.textContent = label; diff --git a/src/ol/control/Control.js b/src/ol/control/Control.js index ebeea4f3e0..873779a2c4 100644 --- a/src/ol/control/Control.js +++ b/src/ol/control/Control.js @@ -10,13 +10,13 @@ import {listen, unlistenByKey} from '../events.js'; /** * @typedef {Object} Options - * @property {Element} [element] The element is the control's + * @property {HTMLElement} [element] The element is the control's * container element. This only needs to be specified if you're developing * a custom control. * @property {function(module:ol/MapEvent)} [render] Function called when * the control should be re-rendered. This is called in a `requestAnimationFrame` * callback. - * @property {Element|string} [target] Specify a target if you want + * @property {HTMLElement|string} [target] Specify a target if you want * the control to be rendered outside of the map's viewport. */ @@ -56,13 +56,13 @@ class Control extends BaseObject { /** * @protected - * @type {Element} + * @type {HTMLElement} */ this.element = options.element ? options.element : null; /** * @private - * @type {Element} + * @type {HTMLElement} */ this.target_ = null; @@ -140,7 +140,7 @@ class Control extends BaseObject { * 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. + * @param {HTMLElement|string} target Target. * @api */ setTarget(target) { diff --git a/src/ol/control/FullScreen.js b/src/ol/control/FullScreen.js index 15ce93e7bc..9de77ff1c6 100644 --- a/src/ol/control/FullScreen.js +++ b/src/ol/control/FullScreen.js @@ -34,16 +34,16 @@ const getChangeType = (function() { /** * @typedef {Object} Options * @property {string} [className='ol-full-screen'] CSS class name. - * @property {string|Element} [label='\u2922'] Text label to use for the button. + * @property {string|HTMLElement} [label='\u2922'] Text label to use for the button. * Instead of text, also an element (e.g. a `span` element) can be used. - * @property {string|Element} [labelActive='\u00d7'] Text label to use for the + * @property {string|HTMLElement} [labelActive='\u00d7'] Text label to use for the * button when full-screen is active. * Instead of text, also an element (e.g. a `span` element) can be used. * @property {string} [tipLabel='Toggle full-screen'] Text label to use for the button tip. * @property {boolean} [keys=false] Full keyboard access. - * @property {Element|string} [target] Specify a target if you want the + * @property {HTMLElement|string} [target] Specify a target if you want the * control to be rendered outside of the map's viewport. - * @property {Element|string} [source] The element to be displayed + * @property {HTMLElement|string} [source] The element to be displayed * fullscreen. When not provided, the element containing the map viewport will * be displayed fullscreen. */ @@ -87,7 +87,7 @@ class FullScreen extends Control { /** * @private - * @type {Element} + * @type {HTMLElement} */ this.labelNode_ = typeof label === 'string' ? document.createTextNode(label) : label; @@ -96,7 +96,7 @@ class FullScreen extends Control { /** * @private - * @type {Element} + * @type {HTMLElement} */ this.labelActiveNode_ = typeof labelActive === 'string' ? document.createTextNode(labelActive) : labelActive; @@ -126,7 +126,7 @@ class FullScreen extends Control { /** * @private - * @type {Element|string|undefined} + * @type {HTMLElement|string|undefined} */ this.source_ = options.source; @@ -231,7 +231,7 @@ function isFullScreen() { /** * Request to fullscreen an element. - * @param {Element} element Element to request fullscreen + * @param {HTMLElement} element Element to request fullscreen */ function requestFullScreen(element) { if (element.requestFullscreen) { @@ -247,7 +247,7 @@ function requestFullScreen(element) { /** * Request to fullscreen an element with keyboard input. - * @param {Element} element Element to request fullscreen + * @param {HTMLElement} element Element to request fullscreen */ function requestFullScreenWithKeys(element) { if (element.mozRequestFullScreenWithKeys) { diff --git a/src/ol/control/OverviewMap.js b/src/ol/control/OverviewMap.js index 435fd4d4cc..8e9379cb4f 100644 --- a/src/ol/control/OverviewMap.js +++ b/src/ol/control/OverviewMap.js @@ -39,17 +39,17 @@ const MIN_RATIO = 0.1; * @typedef {Object} Options * @property {string} [className='ol-overviewmap'] CSS class name. * @property {boolean} [collapsed=true] Whether the control should start collapsed or not (expanded). - * @property {string|Element} [collapseLabel='«'] Text label to use for the + * @property {string|HTMLElement} [collapseLabel='«'] Text label to use for the * expanded overviewmap button. Instead of text, also an element (e.g. a `span` element) can be used. * @property {boolean} [collapsible=true] Whether the control can be collapsed or not. - * @property {string|Element} [label='»'] Text label to use for the collapsed + * @property {string|HTMLElement} [label='»'] Text label to use for the collapsed * overviewmap button. Instead of text, also an element (e.g. a `span` element) can be used. * @property {Array.|module:ol/Collection.} [layers] * Layers for the overview map. If not set, then all main map layers are used * instead. * @property {function(module:ol/MapEvent)} [render] Function called when the control * should be re-rendered. This is called in a `requestAnimationFrame` callback. - * @property {Element|string} [target] Specify a target if you want the control + * @property {HTMLElement|string} [target] Specify a target if you want the control * to be rendered outside of the map's viewport. * @property {string} [tipLabel='Overview map'] Text label to use for the button tip. * @property {module:ol/View} [view] Custom view for the overview map. If not provided, @@ -104,7 +104,7 @@ class OverviewMap extends Control { if (typeof collapseLabel === 'string') { /** * @private - * @type {Element} + * @type {HTMLElement} */ this.collapseLabel_ = document.createElement('span'); this.collapseLabel_.textContent = collapseLabel; @@ -118,7 +118,7 @@ class OverviewMap extends Control { if (typeof label === 'string') { /** * @private - * @type {Element} + * @type {HTMLElement} */ this.label_ = document.createElement('span'); this.label_.textContent = label; @@ -137,7 +137,7 @@ class OverviewMap extends Control { this.handleClick_, this); /** - * @type {Element} + * @type {HTMLElement} * @private */ this.ovmapDiv_ = document.createElement('DIV'); diff --git a/src/ol/control/Rotate.js b/src/ol/control/Rotate.js index 6b364daa66..cccff5dfa9 100644 --- a/src/ol/control/Rotate.js +++ b/src/ol/control/Rotate.js @@ -11,7 +11,7 @@ import EventType from '../events/EventType.js'; /** * @typedef {Object} Options * @property {string} [className='ol-rotate'] CSS class name. - * @property {string|Element} [label='⇧'] Text label to use for the rotate button. + * @property {string|HTMLElement} [label='⇧'] Text label to use for the rotate button. * Instead of text, also an element (e.g. a `span` element) can be used. * @property {string} [tipLabel='Reset rotation'] Text label to use for the rotate tip. * @property {number} [duration=250] Animation duration in milliseconds. @@ -20,7 +20,7 @@ import EventType from '../events/EventType.js'; * be re-rendered. This is called in a `requestAnimationFrame` callback. * @property {function()} [resetNorth] Function called when the control is clicked. * This will override the default `resetNorth`. - * @property {Element|string} [target] Specify a target if you want the control to be + * @property {HTMLElement|string} [target] Specify a target if you want the control to be * rendered outside of the map's viewport. */ @@ -53,7 +53,7 @@ class Rotate extends Control { const label = options.label !== undefined ? options.label : '\u21E7'; /** - * @type {Element} + * @type {HTMLElement} * @private */ this.label_ = null; diff --git a/src/ol/control/ScaleLine.js b/src/ol/control/ScaleLine.js index c854920cfd..ffb86aca12 100644 --- a/src/ol/control/ScaleLine.js +++ b/src/ol/control/ScaleLine.js @@ -42,7 +42,7 @@ const LEADING_DIGITS = [1, 2, 5]; * @property {number} [minWidth=64] Minimum width in pixels. * @property {function(module:ol/MapEvent)} [render] Function called when the control * should be re-rendered. This is called in a `requestAnimationFrame` callback. - * @property {Element|string} [target] Specify a target if you want the control + * @property {HTMLElement|string} [target] Specify a target if you want the control * to be rendered outside of the map's viewport. * @property {module:ol/control/ScaleLine~Units|string} [units='metric'] Units. */ diff --git a/src/ol/control/Zoom.js b/src/ol/control/Zoom.js index b6a0cc1fb1..011e1959fb 100644 --- a/src/ol/control/Zoom.js +++ b/src/ol/control/Zoom.js @@ -12,14 +12,14 @@ import {easeOut} from '../easing.js'; * @typedef {Object} Options * @property {number} [duration=250] Animation duration in milliseconds. * @property {string} [className='ol-zoom'] CSS class name. - * @property {string|Element} [zoomInLabel='+'] Text label to use for the zoom-in + * @property {string|HTMLElement} [zoomInLabel='+'] Text label to use for the zoom-in * button. Instead of text, also an element (e.g. a `span` element) can be used. - * @property {string|Element} [zoomOutLabel='-'] Text label to use for the zoom-out button. + * @property {string|HTMLElement} [zoomOutLabel='-'] Text label to use for the zoom-out button. * Instead of text, also an element (e.g. a `span` element) can be used. * @property {string} [zoomInTipLabel='Zoom in'] Text label to use for the button tip. * @property {string} [zoomOutTipLabel='Zoom out'] Text label to use for the button tip. * @property {number} [delta=1] The zoom delta applied on each click. - * @property {Element|string} [target] Specify a target if you want the control to be + * @property {HTMLElement|string} [target] Specify a target if you want the control to be * rendered outside of the map's viewport. */ diff --git a/src/ol/control/ZoomSlider.js b/src/ol/control/ZoomSlider.js index e2369689c2..3ad70d7724 100644 --- a/src/ol/control/ZoomSlider.js +++ b/src/ol/control/ZoomSlider.js @@ -180,7 +180,7 @@ class ZoomSlider extends Control { width: container.offsetWidth, height: container.offsetHeight }; - const thumb = container.firstElementChild; + const thumb = /** @type {HTMLElement} */ (container.firstElementChild); const computedStyle = getComputedStyle(thumb); const thumbWidth = thumb.offsetWidth + parseFloat(computedStyle['marginRight']) + @@ -242,7 +242,7 @@ class ZoomSlider extends Control { */ handleDraggerDrag_(event) { if (this.dragging_) { - const element = this.element.firstElementChild; + const element = /** @type {HTMLElement} */ (this.element.firstElementChild); const deltaX = event.clientX - this.previousX_ + parseInt(element.style.left, 10); const deltaY = event.clientY - this.previousY_ + parseInt(element.style.top, 10); const relativePosition = this.getRelativePosition_(deltaX, deltaY); @@ -284,7 +284,7 @@ class ZoomSlider extends Control { */ setThumbPosition_(res) { const position = this.getPositionForResolution_(res); - const thumb = this.element.firstElementChild; + const thumb = /** @type {HTMLElement} */ (this.element.firstElementChild); if (this.direction_ == Direction.HORIZONTAL) { thumb.style.left = this.widthLimit_ * position + 'px'; diff --git a/src/ol/control/ZoomToExtent.js b/src/ol/control/ZoomToExtent.js index 22a4e659dd..113f7682ee 100644 --- a/src/ol/control/ZoomToExtent.js +++ b/src/ol/control/ZoomToExtent.js @@ -10,9 +10,9 @@ import {CLASS_CONTROL, CLASS_UNSELECTABLE} from '../css.js'; /** * @typedef {Object} Options * @property {string} [className='ol-zoom-extent'] Class name. - * @property {Element|string} [target] Specify a target if you want the control + * @property {HTMLElement|string} [target] Specify a target if you want the control * to be rendered outside of the map's viewport. - * @property {string|Element} [label='E'] Text label to use for the button. + * @property {string|HTMLElement} [label='E'] Text label to use for the button. * Instead of text, also an element (e.g. a `span` element) can be used. * @property {string} [tipLabel='Fit to extent'] Text label to use for the button tip. * @property {module:ol/extent~Extent} [extent] The extent to zoom to. If undefined the validity diff --git a/src/ol/source/Stamen.js b/src/ol/source/Stamen.js index 20447bffda..3928e59992 100644 --- a/src/ol/source/Stamen.js +++ b/src/ol/source/Stamen.js @@ -95,7 +95,7 @@ const ProviderConfig = { * @property {number} [minZoom] Minimum zoom. * @property {number} [maxZoom] Maximum zoom. * @property {boolean} [opaque] Whether the layer is opaque. - * @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). + * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). * Higher values can increase reprojection performance, but decrease precision. * @property {module:ol/Tile~LoadFunction} [tileLoadFunction] * Optional function to load a tile given a URL. The default is diff --git a/src/ol/source/TileImage.js b/src/ol/source/TileImage.js index 8ac058026a..369c2dfd42 100644 --- a/src/ol/source/TileImage.js +++ b/src/ol/source/TileImage.js @@ -24,7 +24,7 @@ import {getForProjection as getTileGridForProjection} from '../tilegrid.js'; * {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image} for more detail. * @property {boolean} [opaque=true] Whether the layer is opaque. * @property {module:ol/proj~ProjectionLike} projection Projection. - * @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). + * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). * Higher values can increase reprojection performance, but decrease precision. * @property {module:ol/source/State} [state] Source state. * @property {module:ol/ImageTile~TileClass} [tileClass] Class used to instantiate image tiles. diff --git a/src/ol/source/TileJSON.js b/src/ol/source/TileJSON.js index 2013e81079..28302b1d78 100644 --- a/src/ol/source/TileJSON.js +++ b/src/ol/source/TileJSON.js @@ -27,7 +27,7 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js'; * {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image} for more detail. * @property {boolean} [jsonp=false] Use JSONP with callback to load the TileJSON. * Useful when the server does not support CORS.. - * @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). + * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). * Higher values can increase reprojection performance, but decrease precision. * @property {tileJSON} [tileJSON] TileJSON configuration for this source. * If not provided, `url` must be configured. diff --git a/src/ol/source/TileWMS.js b/src/ol/source/TileWMS.js index 13add52b03..9586c9bc0c 100644 --- a/src/ol/source/TileWMS.js +++ b/src/ol/source/TileWMS.js @@ -41,7 +41,7 @@ import {appendParams} from '../uri.js'; * @property {boolean} [hidpi=true] Use the `ol/Map#pixelRatio` value when requesting * the image from the remote server. * @property {module:ol/proj~ProjectionLike} projection Projection. - * @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). + * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). * Higher values can increase reprojection performance, but decrease precision. * @property {module:ol/ImageTile~TileClass} [tileClass] Class used to instantiate image tiles. * Default is {@link module:ol/ImageTile~TileClass}. diff --git a/src/ol/source/WMTS.js b/src/ol/source/WMTS.js index 0ec7a21a15..38c6d86678 100644 --- a/src/ol/source/WMTS.js +++ b/src/ol/source/WMTS.js @@ -22,7 +22,7 @@ import {appendParams} from '../uri.js'; * {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image} for more detail. * @property {module:ol/tilegrid/WMTS} tileGrid Tile grid. * @property {module:ol/proj~ProjectionLike} projection Projection. - * @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). + * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). * Higher values can increase reprojection performance, but decrease precision. * @property {module:ol/source/WMTSRequestEncoding|string} [requestEncoding='KVP'] Request encoding. * @property {string} layer Layer name as advertised in the WMTS capabilities. diff --git a/src/ol/source/XYZ.js b/src/ol/source/XYZ.js index ddabfaf5cf..ecc49e81ab 100644 --- a/src/ol/source/XYZ.js +++ b/src/ol/source/XYZ.js @@ -15,7 +15,7 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js'; * {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image} for more detail. * @property {boolean} [opaque=true] Whether the layer is opaque. * @property {module:ol/proj~ProjectionLike} [projection='EPSG:3857'] Projection. - * @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). + * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). * Higher values can increase reprojection performance, but decrease precision. * @property {number} [maxZoom=18] Optional max zoom level. * @property {number} [minZoom=0] Optional min zoom level. diff --git a/src/ol/source/Zoomify.js b/src/ol/source/Zoomify.js index b6f58be100..3b83cfeb0a 100644 --- a/src/ol/source/Zoomify.js +++ b/src/ol/source/Zoomify.js @@ -89,7 +89,7 @@ CustomTile.prototype.getImage = function() { * access pixel data with the Canvas renderer. See * {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image} for more detail. * @property {module:ol/proj~ProjectionLike} [projection] Projection. - * @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). + * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). * Higher values can increase reprojection performance, but decrease precision. * @property {string} [url] URL template or base URL of the Zoomify service. * A base URL is the fixed part diff --git a/src/ol/structs/LRUCache.js b/src/ol/structs/LRUCache.js index edec88d778..a9e68ac268 100644 --- a/src/ol/structs/LRUCache.js +++ b/src/ol/structs/LRUCache.js @@ -16,15 +16,17 @@ import EventType from '../events/EventType.js'; */ +/** + * Implements a Least-Recently-Used cache where the keys do not conflict with + * Object's properties (e.g. 'hasOwnProperty' is not allowed as a key). Expiring + * items from the cache is the responsibility of the user. + * + * @fires module:ol/events/Event~Event + * @template T + */ class LRUCache extends EventTarget { /** - * Implements a Least-Recently-Used cache where the keys do not conflict with - * Object's properties (e.g. 'hasOwnProperty' is not allowed as a key). Expiring - * items from the cache is the responsibility of the user. - * - * @fires module:ol/events/Event~Event - * @template T * @param {number=} opt_highWaterMark High water mark. */ constructor(opt_highWaterMark) { diff --git a/src/ol/structs/PriorityQueue.js b/src/ol/structs/PriorityQueue.js index c78cb3b3dc..c82eb12a77 100644 --- a/src/ol/structs/PriorityQueue.js +++ b/src/ol/structs/PriorityQueue.js @@ -11,19 +11,22 @@ import {clear} from '../obj.js'; export const DROP = Infinity; +/** + * Priority queue. + * + * The implementation is inspired from the Closure Library's Heap class and + * Python's heapq module. + * + * @see http://closure-library.googlecode.com/svn/docs/closure_goog_structs_heap.js.source.html + * @see http://hg.python.org/cpython/file/2.7/Lib/heapq.py + * + * @template T + */ class PriorityQueue { + /** - * Priority queue. - * - * The implementation is inspired from the Closure Library's Heap class and - * Python's heapq module. - * - * @see http://closure-library.googlecode.com/svn/docs/closure_goog_structs_heap.js.source.html - * @see http://hg.python.org/cpython/file/2.7/Lib/heapq.py - * * @param {function(T): number} priorityFunction Priority function. * @param {function(T): string} keyFunction Key function. - * @template T */ constructor(priorityFunction, keyFunction) { diff --git a/src/ol/structs/RBush.js b/src/ol/structs/RBush.js index 1039171e97..3221b85086 100644 --- a/src/ol/structs/RBush.js +++ b/src/ol/structs/RBush.js @@ -15,14 +15,16 @@ import {isEmpty} from '../obj.js'; * @property {Object} [value] */ +/** + * Wrapper around the RBush by Vladimir Agafonkin. + * + * @see https://github.com/mourner/rbush + * @template T + */ class RBush { /** - * Wrapper around the RBush by Vladimir Agafonkin. - * * @param {number=} opt_maxEntries Max entries. - * @see https://github.com/mourner/rbush - * @template T */ constructor(opt_maxEntries) {