diff --git a/src/ol/Collection.js b/src/ol/Collection.js index c4f11d298d..80267e29f5 100644 --- a/src/ol/Collection.js +++ b/src/ol/Collection.js @@ -24,7 +24,7 @@ const Property = { export class CollectionEvent extends Event { /** - * @param {module:ol/CollectionEventType} type Type. + * @param {import("./CollectionEventType.js").default} type Type. * @param {*=} opt_element Element. */ constructor(type, opt_element) { @@ -63,7 +63,7 @@ class Collection extends BaseObject { /** * @param {Array=} opt_array Array. - * @param {module:ol/Collection~Options=} opt_options Collection options. + * @param {Options=} opt_options Collection options. */ constructor(opt_array, opt_options) { @@ -107,7 +107,7 @@ class Collection extends BaseObject { * Add elements to the collection. This pushes each item in the provided array * to the end of the collection. * @param {!Array} arr Array. - * @return {module:ol/Collection} This collection. + * @return {import("./Collection.js").default} This collection. * @api */ extend(arr) { diff --git a/src/ol/Feature.js b/src/ol/Feature.js index fe5fc38872..4f21db871a 100644 --- a/src/ol/Feature.js +++ b/src/ol/Feature.js @@ -54,7 +54,7 @@ import Style from './style/Style.js'; */ class Feature extends BaseObject { /** - * @param {module:ol/geom/Geometry|Object=} opt_geometryOrProperties + * @param {import("./geom/Geometry.js").default|Object=} opt_geometryOrProperties * You may pass a Geometry object directly, or an object literal containing * properties. If you pass an object literal, you may include a Geometry * associated with a `geometry` key. @@ -78,19 +78,19 @@ class Feature extends BaseObject { /** * User provided style. * @private - * @type {module:ol/style/Style|Array|module:ol/style/Style~StyleFunction} + * @type {import("./style/Style.js").default|Array|import("./style/Style.js").StyleFunction} */ this.style_ = null; /** * @private - * @type {module:ol/style/Style~StyleFunction|undefined} + * @type {import("./style/Style.js").StyleFunction|undefined} */ this.styleFunction_ = undefined; /** * @private - * @type {?module:ol/events~EventsKey} + * @type {?import("./events.js").EventsKey} */ this.geometryChangeKey_ = null; @@ -114,7 +114,7 @@ class Feature extends BaseObject { /** * Clone this feature. If the original feature has a geometry it * is also cloned. The feature id is not set in the clone. - * @return {module:ol/Feature} The clone. + * @return {import("./Feature.js").default} The clone. * @api */ clone() { @@ -135,13 +135,13 @@ class Feature extends BaseObject { * Get the feature's default geometry. A feature may have any number of named * geometries. The "default" geometry (the one that is rendered by default) is * set when calling {@link module:ol/Feature~Feature#setGeometry}. - * @return {module:ol/geom/Geometry|undefined} The default geometry for the feature. + * @return {import("./geom/Geometry.js").default|undefined} The default geometry for the feature. * @api * @observable */ getGeometry() { return ( - /** @type {module:ol/geom/Geometry|undefined} */ (this.get(this.geometryName_)) + /** @type {import("./geom/Geometry.js").default|undefined} */ (this.get(this.geometryName_)) ); } @@ -170,7 +170,7 @@ class Feature extends BaseObject { /** * Get the feature's style. Will return what was provided to the * {@link module:ol/Feature~Feature#setStyle} method. - * @return {module:ol/style/Style|Array|module:ol/style/Style~StyleFunction} The feature style. + * @return {import("./style/Style.js").default|Array|import("./style/Style.js").StyleFunction} The feature style. * @api */ getStyle() { @@ -179,7 +179,7 @@ class Feature extends BaseObject { /** * Get the feature's style function. - * @return {module:ol/style/Style~StyleFunction|undefined} Return a function + * @return {import("./style/Style.js").StyleFunction|undefined} Return a function * representing the current style of this feature. * @api */ @@ -213,7 +213,7 @@ class Feature extends BaseObject { /** * Set the default geometry for the feature. This will update the property * with the name returned by {@link module:ol/Feature~Feature#getGeometryName}. - * @param {module:ol/geom/Geometry|undefined} geometry The new geometry. + * @param {import("./geom/Geometry.js").default|undefined} geometry The new geometry. * @api * @observable */ @@ -225,7 +225,7 @@ class Feature extends BaseObject { * Set the style for the feature. This can be a single style object, an array * of styles, or a function that takes a resolution and returns an array of * styles. If it is `null` the feature has no style (a `null` style). - * @param {module:ol/style/Style|Array|module:ol/style/Style~StyleFunction} style Style for this feature. + * @param {import("./style/Style.js").default|Array|import("./style/Style.js").StyleFunction} style Style for this feature. * @api * @fires module:ol/events/Event~Event#event:change */ @@ -271,25 +271,25 @@ class Feature extends BaseObject { /** * Convert the provided object into a feature style function. Functions passed - * through unchanged. Arrays of module:ol/style/Style or single style objects wrapped + * through unchanged. Arrays of import("./style/Style.js").default or single style objects wrapped * in a new feature style function. - * @param {module:ol/style/Style~StyleFunction|!Array|!module:ol/style/Style} obj + * @param {import("./style/Style.js").StyleFunction|!Array|!import("./style/Style.js").default} obj * A feature style function, a single style, or an array of styles. - * @return {module:ol/style/Style~StyleFunction} A style function. + * @return {import("./style/Style.js").StyleFunction} A style function. */ export function createStyleFunction(obj) { if (typeof obj === 'function') { return obj; } else { /** - * @type {Array} + * @type {Array} */ let styles; if (Array.isArray(obj)) { styles = obj; } else { assert(obj instanceof Style, - 41); // Expected an `module:ol/style/Style~Style` or an array of `module:ol/style/Style~Style` + 41); // Expected an `import("./style/Style.js").Style` or an array of `import("./style/Style.js").Style` styles = [obj]; } return function() { diff --git a/src/ol/Geolocation.js b/src/ol/Geolocation.js index 84115dffca..f58127ddb3 100644 --- a/src/ol/Geolocation.js +++ b/src/ol/Geolocation.js @@ -17,7 +17,7 @@ import {get as getProjection, getTransformFromProjections, identityTransform} fr * instantiation. * @property {PositionOptions} [trackingOptions] Tracking options. * See http://www.w3.org/TR/geolocation-API/#position_options_interface. - * @property {module:ol/proj~ProjectionLike} [projection] The projection the position + * @property {import("./proj.js").ProjectionLike} [projection] The projection the position * is reported in. */ @@ -48,7 +48,7 @@ import {get as getProjection, getTransformFromProjections, identityTransform} fr class Geolocation extends BaseObject { /** - * @param {module:ol/Geolocation~Options=} opt_options Options. + * @param {Options=} opt_options Options. */ constructor(opt_options) { @@ -59,13 +59,13 @@ class Geolocation extends BaseObject { /** * The unprojected (EPSG:4326) device position. * @private - * @type {module:ol/coordinate~Coordinate} + * @type {import("./coordinate.js").Coordinate} */ this.position_ = null; /** * @private - * @type {module:ol/proj~TransformFunction} + * @type {import("./proj.js").TransformFunction} */ this.transform_ = identityTransform; @@ -192,13 +192,13 @@ class Geolocation extends BaseObject { /** * Get a geometry of the position accuracy. - * @return {?module:ol/geom/Polygon} A geometry of the position accuracy. + * @return {?import("./geom/Polygon.js").default} A geometry of the position accuracy. * @observable * @api */ getAccuracyGeometry() { return ( - /** @type {?module:ol/geom/Polygon} */ (this.get(GeolocationProperty.ACCURACY_GEOMETRY) || null) + /** @type {?import("./geom/Polygon.js").default} */ (this.get(GeolocationProperty.ACCURACY_GEOMETRY) || null) ); } @@ -238,27 +238,27 @@ class Geolocation extends BaseObject { /** * Get the position of the device. - * @return {module:ol/coordinate~Coordinate|undefined} The current position of the device reported + * @return {import("./coordinate.js").Coordinate|undefined} The current position of the device reported * in the current projection. * @observable * @api */ getPosition() { return ( - /** @type {module:ol/coordinate~Coordinate|undefined} */ (this.get(GeolocationProperty.POSITION)) + /** @type {import("./coordinate.js").Coordinate|undefined} */ (this.get(GeolocationProperty.POSITION)) ); } /** * Get the projection associated with the position. - * @return {module:ol/proj/Projection|undefined} The projection the position is + * @return {import("./proj/Projection.js").default|undefined} The projection the position is * reported in. * @observable * @api */ getProjection() { return ( - /** @type {module:ol/proj/Projection|undefined} */ (this.get(GeolocationProperty.PROJECTION)) + /** @type {import("./proj/Projection.js").default|undefined} */ (this.get(GeolocationProperty.PROJECTION)) ); } @@ -298,7 +298,7 @@ class Geolocation extends BaseObject { /** * Set the projection to use for transforming the coordinates. - * @param {module:ol/proj~ProjectionLike} projection The projection the position is + * @param {import("./proj.js").ProjectionLike} projection The projection the position is * reported in. * @observable * @api diff --git a/src/ol/Graticule.js b/src/ol/Graticule.js index 45a59f7bdf..3c0a229637 100644 --- a/src/ol/Graticule.js +++ b/src/ol/Graticule.js @@ -17,7 +17,7 @@ import Text from './style/Text.js'; /** - * @type {module:ol/style/Stroke} + * @type {import("./style/Stroke.js").default} * @private * @const */ @@ -36,13 +36,13 @@ const INTERVALS = [ /** * @typedef {Object} GraticuleLabelDataType - * @property {module:ol/geom/Point} geom + * @property {import("./geom/Point.js").default} geom * @property {string} text */ /** * @typedef {Object} Options - * @property {module:ol/PluggableMap} [map] Reference to an + * @property {import("./PluggableMap.js").default} [map] Reference to an * {@link module:ol/Map~Map} object. * @property {number} [maxLines=100] The maximum number of meridians and * parallels from the center of the map. The default value of 100 means that at @@ -50,7 +50,7 @@ const INTERVALS = [ * appropriate for conformal projections like Spherical Mercator. If you * increase the value, more lines will be drawn and the drawing performance will * decrease. - * @property {module:ol/style/Stroke} [strokeStyle='rgba(0,0,0,0.2)'] The + * @property {import("./style/Stroke.js").default} [strokeStyle='rgba(0,0,0,0.2)'] The * stroke style to use for drawing the graticule. If not provided, a not fully * opaque black will be used. * @property {number} [targetSize=100] The target size of the graticule cells, @@ -71,7 +71,7 @@ const INTERVALS = [ * @property {number} [latLabelPosition=1] Latitude label position in fractions * (0..1) of view extent. 0 means at the left of the viewport, 1 means at the * right. - * @property {module:ol/style/Text} [lonLabelStyle] Longitude label text + * @property {import("./style/Text.js").default} [lonLabelStyle] Longitude label text * style. If not provided, the following style will be used: * ```js * new Text({ @@ -89,7 +89,7 @@ const INTERVALS = [ * Note that the default's `textBaseline` configuration will not work well for * `lonLabelPosition` configurations that position labels close to the top of * the viewport. - * @property {module:ol/style/Text} [latLabelStyle] Latitude label text style. + * @property {import("./style/Text.js").default} [latLabelStyle] Latitude label text style. * If not provided, the following style will be used: * ```js * new Text({ @@ -117,25 +117,25 @@ const INTERVALS = [ class Graticule { /** - * @param {module:ol/Graticule~Options=} opt_options Options. + * @param {Options=} opt_options Options. */ constructor(opt_options) { const options = opt_options || {}; /** - * @type {module:ol/PluggableMap} + * @type {import("./PluggableMap.js").default} * @private */ this.map_ = null; /** - * @type {?module:ol/events~EventsKey} + * @type {?import("./events.js").EventsKey} * @private */ this.postcomposeListenerKey_ = null; /** - * @type {module:ol/proj/Projection} + * @type {import("./proj/Projection.js").default} */ this.projection_ = null; @@ -200,49 +200,49 @@ class Graticule { this.maxLines_ = options.maxLines !== undefined ? options.maxLines : 100; /** - * @type {Array} + * @type {Array} * @private */ this.meridians_ = []; /** - * @type {Array} + * @type {Array} * @private */ this.parallels_ = []; /** - * @type {module:ol/style/Stroke} + * @type {import("./style/Stroke.js").default} * @private */ this.strokeStyle_ = options.strokeStyle !== undefined ? options.strokeStyle : DEFAULT_STROKE_STYLE; /** - * @type {module:ol/proj~TransformFunction|undefined} + * @type {import("./proj.js").TransformFunction|undefined} * @private */ this.fromLonLatTransform_ = undefined; /** - * @type {module:ol/proj~TransformFunction|undefined} + * @type {import("./proj.js").TransformFunction|undefined} * @private */ this.toLonLatTransform_ = undefined; /** - * @type {module:ol/coordinate~Coordinate} + * @type {import("./coordinate.js").Coordinate} * @private */ this.projectionCenterLonLat_ = null; /** - * @type {Array} + * @type {Array} * @private */ this.meridiansLabels_ = null; /** - * @type {Array} + * @type {Array} * @private */ this.parallelsLabels_ = null; @@ -282,7 +282,7 @@ class Graticule { options.latLabelPosition; /** - * @type {module:ol/style/Text} + * @type {import("./style/Text.js").default} * @private */ this.lonLabelStyle_ = options.lonLabelStyle !== undefined ? options.lonLabelStyle : @@ -299,7 +299,7 @@ class Graticule { }); /** - * @type {module:ol/style/Text} + * @type {import("./style/Text.js").default} * @private */ this.latLabelStyle_ = options.latLabelStyle !== undefined ? options.latLabelStyle : @@ -327,7 +327,7 @@ class Graticule { * @param {number} minLat Minimal latitude. * @param {number} maxLat Maximal latitude. * @param {number} squaredTolerance Squared tolerance. - * @param {module:ol/extent~Extent} extent Extent. + * @param {import("./extent.js").Extent} extent Extent. * @param {number} index Index. * @return {number} Index. * @private @@ -348,10 +348,10 @@ class Graticule { } /** - * @param {module:ol/geom/LineString} lineString Meridian - * @param {module:ol/extent~Extent} extent Extent. + * @param {import("./geom/LineString.js").default} lineString Meridian + * @param {import("./extent.js").Extent} extent Extent. * @param {number} index Index. - * @return {module:ol/geom/Point} Meridian point. + * @return {import("./geom/Point.js").default} Meridian point. * @private */ getMeridianPoint_(lineString, extent, index) { @@ -377,7 +377,7 @@ class Graticule { * @param {number} minLon Minimal longitude. * @param {number} maxLon Maximal longitude. * @param {number} squaredTolerance Squared tolerance. - * @param {module:ol/extent~Extent} extent Extent. + * @param {import("./extent.js").Extent} extent Extent. * @param {number} index Index. * @return {number} Index. * @private @@ -398,10 +398,10 @@ class Graticule { } /** - * @param {module:ol/geom/LineString} lineString Parallels. - * @param {module:ol/extent~Extent} extent Extent. + * @param {import("./geom/LineString.js").default} lineString Parallels. + * @param {import("./extent.js").Extent} extent Extent. * @param {number} index Index. - * @return {module:ol/geom/Point} Parallel point. + * @return {import("./geom/Point.js").default} Parallel point. * @private */ getParallelPoint_(lineString, extent, index) { @@ -423,8 +423,8 @@ class Graticule { } /** - * @param {module:ol/extent~Extent} extent Extent. - * @param {module:ol/coordinate~Coordinate} center Center. + * @param {import("./extent.js").Extent} extent Extent. + * @param {import("./coordinate.js").Coordinate} center Center. * @param {number} resolution Resolution. * @param {number} squaredTolerance Squared tolerance. * @private @@ -549,7 +549,7 @@ class Graticule { /** * Get the map associated with this graticule. - * @return {module:ol/PluggableMap} The map. + * @return {import("./PluggableMap.js").default} The map. * @api */ getMap() { @@ -561,7 +561,7 @@ class Graticule { * @param {number} minLat Minimal latitude. * @param {number} maxLat Maximal latitude. * @param {number} squaredTolerance Squared tolerance. - * @return {module:ol/geom/LineString} The meridian line string. + * @return {import("./geom/LineString.js").default} The meridian line string. * @param {number} index Index. * @private */ @@ -579,7 +579,7 @@ class Graticule { /** * Get the list of meridians. Meridians are lines of equal longitude. - * @return {Array} The meridians. + * @return {Array} The meridians. * @api */ getMeridians() { @@ -591,7 +591,7 @@ class Graticule { * @param {number} minLon Minimal longitude. * @param {number} maxLon Maximal longitude. * @param {number} squaredTolerance Squared tolerance. - * @return {module:ol/geom/LineString} The parallel line string. + * @return {import("./geom/LineString.js").default} The parallel line string. * @param {number} index Index. * @private */ @@ -609,7 +609,7 @@ class Graticule { /** * Get the list of parallels. Parallels are lines of equal latitude. - * @return {Array} The parallels. + * @return {Array} The parallels. * @api */ getParallels() { @@ -617,7 +617,7 @@ class Graticule { } /** - * @param {module:ol/render/Event} e Event. + * @param {import("./render/Event.js").default} e Event. * @private */ handlePostCompose_(e) { @@ -672,7 +672,7 @@ class Graticule { } /** - * @param {module:ol/proj/Projection} projection Projection. + * @param {import("./proj/Projection.js").default} projection Projection. * @private */ updateProjectionInfo_(projection) { @@ -703,7 +703,7 @@ class Graticule { /** * Set the map for this graticule. The graticule will be rendered on the * provided map. - * @param {module:ol/PluggableMap} map Map. + * @param {import("./PluggableMap.js").default} map Map. * @api */ setMap(map) { diff --git a/src/ol/Image.js b/src/ol/Image.js index 7305e5a678..c9e8117f02 100644 --- a/src/ol/Image.js +++ b/src/ol/Image.js @@ -22,7 +22,7 @@ import {getHeight} from './extent.js'; * post requests or - in general - through XHR requests, where the src of the * image element would be set to a data URI when the content is loaded. * - * @typedef {function(module:ol/Image, string)} LoadFunction + * @typedef {function(import("./Image.js").default, string)} LoadFunction * @api */ @@ -30,12 +30,12 @@ import {getHeight} from './extent.js'; class ImageWrapper extends ImageBase { /** - * @param {module:ol/extent~Extent} extent Extent. + * @param {import("./extent.js").Extent} extent Extent. * @param {number|undefined} resolution Resolution. * @param {number} pixelRatio Pixel ratio. * @param {string} src Image source URI. * @param {?string} crossOrigin Cross origin. - * @param {module:ol/Image~LoadFunction} imageLoadFunction Image load function. + * @param {LoadFunction} imageLoadFunction Image load function. */ constructor(extent, resolution, pixelRatio, src, crossOrigin, imageLoadFunction) { @@ -58,19 +58,19 @@ class ImageWrapper extends ImageBase { /** * @private - * @type {Array} + * @type {Array} */ this.imageListenerKeys_ = null; /** * @protected - * @type {module:ol/ImageState} + * @type {import("./ImageState.js").default} */ this.state = ImageState.IDLE; /** * @private - * @type {module:ol/Image~LoadFunction} + * @type {LoadFunction} */ this.imageLoadFunction_ = imageLoadFunction; diff --git a/src/ol/ImageBase.js b/src/ol/ImageBase.js index 967d6674ab..f512a0924f 100644 --- a/src/ol/ImageBase.js +++ b/src/ol/ImageBase.js @@ -10,10 +10,10 @@ import EventType from './events/EventType.js'; class ImageBase extends EventTarget { /** - * @param {module:ol/extent~Extent} extent Extent. + * @param {import("./extent.js").Extent} extent Extent. * @param {number|undefined} resolution Resolution. * @param {number} pixelRatio Pixel ratio. - * @param {module:ol/ImageState} state State. + * @param {import("./ImageState.js").default} state State. */ constructor(extent, resolution, pixelRatio, state) { @@ -21,7 +21,7 @@ class ImageBase extends EventTarget { /** * @protected - * @type {module:ol/extent~Extent} + * @type {import("./extent.js").Extent} */ this.extent = extent; @@ -39,7 +39,7 @@ class ImageBase extends EventTarget { /** * @protected - * @type {module:ol/ImageState} + * @type {import("./ImageState.js").default} */ this.state = state; @@ -53,7 +53,7 @@ class ImageBase extends EventTarget { } /** - * @return {module:ol/extent~Extent} Extent. + * @return {import("./extent.js").Extent} Extent. */ getExtent() { return this.extent; @@ -80,7 +80,7 @@ class ImageBase extends EventTarget { } /** - * @return {module:ol/ImageState} State. + * @return {import("./ImageState.js").default} State. */ getState() { return this.state; diff --git a/src/ol/ImageCanvas.js b/src/ol/ImageCanvas.js index df586aebfe..792cccbdec 100644 --- a/src/ol/ImageCanvas.js +++ b/src/ol/ImageCanvas.js @@ -18,11 +18,11 @@ import ImageState from './ImageState.js'; class ImageCanvas extends ImageBase { /** - * @param {module:ol/extent~Extent} extent Extent. + * @param {import("./extent.js").Extent} extent Extent. * @param {number} resolution Resolution. * @param {number} pixelRatio Pixel ratio. * @param {HTMLCanvasElement} canvas Canvas. - * @param {module:ol/ImageCanvas~Loader=} opt_loader Optional loader function to + * @param {Loader=} opt_loader Optional loader function to * support asynchronous canvas drawing. */ constructor(extent, resolution, pixelRatio, canvas, opt_loader) { @@ -33,7 +33,7 @@ class ImageCanvas extends ImageBase { /** * Optional canvas loader function. - * @type {?module:ol/ImageCanvas~Loader} + * @type {?Loader} * @private */ this.loader_ = opt_loader !== undefined ? opt_loader : null; diff --git a/src/ol/ImageTile.js b/src/ol/ImageTile.js index 8a476f4ab3..9538a4232c 100644 --- a/src/ol/ImageTile.js +++ b/src/ol/ImageTile.js @@ -8,20 +8,20 @@ import {listenOnce, unlistenByKey} from './events.js'; import EventType from './events/EventType.js'; /** - * @typedef {function(new: module:ol/ImageTile, module:ol/tilecoord~TileCoord, - * module:ol/TileState, string, ?string, module:ol/Tile~LoadFunction)} TileClass + * @typedef {function(new: import("./ImageTile.js").default, import("./tilecoord.js").TileCoord, + * import("./TileState.js").default, string, ?string, import("./Tile.js").LoadFunction)} TileClass * @api */ class ImageTile extends Tile { /** - * @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate. - * @param {module:ol/TileState} state State. + * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate. + * @param {import("./TileState.js").default} state State. * @param {string} src Image source URI. * @param {?string} crossOrigin Cross origin. - * @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function. - * @param {module:ol/Tile~Options=} opt_options Tile options. + * @param {import("./Tile.js").LoadFunction} tileLoadFunction Tile load function. + * @param {import("./Tile.js").Options=} opt_options Tile options. */ constructor(tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options) { @@ -52,13 +52,13 @@ class ImageTile extends Tile { /** * @private - * @type {Array} + * @type {Array} */ this.imageListenerKeys_ = null; /** * @private - * @type {module:ol/Tile~LoadFunction} + * @type {import("./Tile.js").LoadFunction} */ this.tileLoadFunction_ = tileLoadFunction; diff --git a/src/ol/Map.js b/src/ol/Map.js index 32363f8d9b..8ef2a8111c 100644 --- a/src/ol/Map.js +++ b/src/ol/Map.js @@ -56,8 +56,8 @@ import CanvasVectorTileLayerRenderer from './renderer/canvas/VectorTileLayer.js' * options or added with `addLayer` can be groups, which can contain further * groups, and so on. * - * @fires module:ol/MapBrowserEvent~MapBrowserEvent - * @fires module:ol/MapEvent~MapEvent + * @fires import("./MapBrowserEvent.js").MapBrowserEvent + * @fires import("./MapEvent.js").MapEvent * @fires module:ol/render/Event~RenderEvent#postcompose * @fires module:ol/render/Event~RenderEvent#precompose * @api @@ -65,7 +65,7 @@ import CanvasVectorTileLayerRenderer from './renderer/canvas/VectorTileLayer.js' class Map extends PluggableMap { /** - * @param {module:ol/PluggableMap~MapOptions} options Map options. + * @param {import("./PluggableMap.js").MapOptions} options Map options. */ constructor(options) { options = assign({}, options); diff --git a/src/ol/MapBrowserEvent.js b/src/ol/MapBrowserEvent.js index 27ee3b8bba..074132afc8 100644 --- a/src/ol/MapBrowserEvent.js +++ b/src/ol/MapBrowserEvent.js @@ -12,10 +12,10 @@ class MapBrowserEvent extends MapEvent { /** * @param {string} type Event type. - * @param {module:ol/PluggableMap} map Map. + * @param {import("./PluggableMap.js").default} map Map. * @param {Event} browserEvent Browser event. * @param {boolean=} opt_dragging Is the map currently being dragged? - * @param {?module:ol/PluggableMap~FrameState=} opt_frameState Frame state. + * @param {?import("./PluggableMap.js").FrameState=} opt_frameState Frame state. */ constructor(type, map, browserEvent, opt_dragging, opt_frameState) { @@ -31,14 +31,14 @@ class MapBrowserEvent extends MapEvent { /** * The map pixel relative to the viewport corresponding to the original browser event. - * @type {module:ol/pixel~Pixel} + * @type {import("./pixel.js").Pixel} * @api */ this.pixel = map.getEventPixel(browserEvent); /** * The coordinate in view projection corresponding to the original browser event. - * @type {module:ol/coordinate~Coordinate} + * @type {import("./coordinate.js").Coordinate} * @api */ this.coordinate = map.getCoordinateFromPixel(this.pixel); diff --git a/src/ol/MapBrowserEventHandler.js b/src/ol/MapBrowserEventHandler.js index e4f83f094c..3567635900 100644 --- a/src/ol/MapBrowserEventHandler.js +++ b/src/ol/MapBrowserEventHandler.js @@ -12,7 +12,7 @@ import PointerEventHandler from './pointer/PointerEventHandler.js'; class MapBrowserEventHandler extends EventTarget { /** - * @param {module:ol/PluggableMap} map The map with the viewport to listen to events on. + * @param {import("./PluggableMap.js").default} map The map with the viewport to listen to events on. * @param {number=} moveTolerance The minimal distance the pointer must travel to trigger a move. */ constructor(map, moveTolerance) { @@ -21,7 +21,7 @@ class MapBrowserEventHandler extends EventTarget { /** * This is the element that we will listen to the real events on. - * @type {module:ol/PluggableMap} + * @type {import("./PluggableMap.js").default} * @private */ this.map_ = map; @@ -39,7 +39,7 @@ class MapBrowserEventHandler extends EventTarget { this.dragging_ = false; /** - * @type {!Array} + * @type {!Array} * @private */ this.dragListenerKeys_ = []; @@ -54,7 +54,7 @@ class MapBrowserEventHandler extends EventTarget { /** * The most recent "down" type event (or null if none have occurred). * Set on pointerdown. - * @type {module:ol/pointer/PointerEvent} + * @type {import("./pointer/PointerEvent.js").default} * @private */ this.down_ = null; @@ -77,7 +77,7 @@ class MapBrowserEventHandler extends EventTarget { * Event handler which generates pointer events for * the viewport element. * - * @type {module:ol/pointer/PointerEventHandler} + * @type {import("./pointer/PointerEventHandler.js").default} * @private */ this.pointerEventHandler_ = new PointerEventHandler(element); @@ -86,13 +86,13 @@ class MapBrowserEventHandler extends EventTarget { * Event handler which generates pointer events for * the document (used when dragging). * - * @type {module:ol/pointer/PointerEventHandler} + * @type {import("./pointer/PointerEventHandler.js").default} * @private */ this.documentPointerEventHandler_ = null; /** - * @type {?module:ol/events~EventsKey} + * @type {?import("./events.js").EventsKey} * @private */ this.pointerdownListenerKey_ = listen(this.pointerEventHandler_, @@ -100,7 +100,7 @@ class MapBrowserEventHandler extends EventTarget { this.handlePointerDown_, this); /** - * @type {?module:ol/events~EventsKey} + * @type {?import("./events.js").EventsKey} * @private */ this.relayedListenerKey_ = listen(this.pointerEventHandler_, @@ -110,7 +110,7 @@ class MapBrowserEventHandler extends EventTarget { } /** - * @param {module:ol/pointer/PointerEvent} pointerEvent Pointer + * @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer * event. * @private */ @@ -139,7 +139,7 @@ class MapBrowserEventHandler extends EventTarget { /** * Keeps track on how many pointers are currently active. * - * @param {module:ol/pointer/PointerEvent} pointerEvent Pointer + * @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer * event. * @private */ @@ -156,7 +156,7 @@ class MapBrowserEventHandler extends EventTarget { } /** - * @param {module:ol/pointer/PointerEvent} pointerEvent Pointer + * @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer * event. * @private */ @@ -187,7 +187,7 @@ class MapBrowserEventHandler extends EventTarget { } /** - * @param {module:ol/pointer/PointerEvent} pointerEvent Pointer + * @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer * event. * @return {boolean} If the left mouse button was pressed. * @private @@ -197,7 +197,7 @@ class MapBrowserEventHandler extends EventTarget { } /** - * @param {module:ol/pointer/PointerEvent} pointerEvent Pointer + * @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer * event. * @private */ @@ -245,7 +245,7 @@ class MapBrowserEventHandler extends EventTarget { } /** - * @param {module:ol/pointer/PointerEvent} pointerEvent Pointer + * @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer * event. * @private */ @@ -271,7 +271,7 @@ class MapBrowserEventHandler extends EventTarget { /** * Wrap and relay a pointer event. Note that this requires that the type * string for the MapBrowserPointerEvent matches the PointerEvent type. - * @param {module:ol/pointer/PointerEvent} pointerEvent Pointer + * @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer * event. * @private */ @@ -282,7 +282,7 @@ class MapBrowserEventHandler extends EventTarget { } /** - * @param {module:ol/pointer/PointerEvent} pointerEvent Pointer + * @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer * event. * @return {boolean} Is moving. * @private diff --git a/src/ol/MapBrowserPointerEvent.js b/src/ol/MapBrowserPointerEvent.js index a12823d616..2fe55ec7d7 100644 --- a/src/ol/MapBrowserPointerEvent.js +++ b/src/ol/MapBrowserPointerEvent.js @@ -7,10 +7,10 @@ class MapBrowserPointerEvent extends MapBrowserEvent { /** * @param {string} type Event type. - * @param {module:ol/PluggableMap} map Map. - * @param {module:ol/pointer/PointerEvent} pointerEvent Pointer event. + * @param {import("./PluggableMap.js").default} map Map. + * @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer event. * @param {boolean=} opt_dragging Is the map currently being dragged? - * @param {?module:ol/PluggableMap~FrameState=} opt_frameState Frame state. + * @param {?import("./PluggableMap.js").FrameState=} opt_frameState Frame state. */ constructor(type, map, pointerEvent, opt_dragging, opt_frameState) { @@ -18,7 +18,7 @@ class MapBrowserPointerEvent extends MapBrowserEvent { /** * @const - * @type {module:ol/pointer/PointerEvent} + * @type {import("./pointer/PointerEvent.js").default} */ this.pointerEvent = pointerEvent; diff --git a/src/ol/MapEvent.js b/src/ol/MapEvent.js index ae79b5016c..83a1ed9827 100644 --- a/src/ol/MapEvent.js +++ b/src/ol/MapEvent.js @@ -12,8 +12,8 @@ class MapEvent extends Event { /** * @param {string} type Event type. - * @param {module:ol/PluggableMap} map Map. - * @param {?module:ol/PluggableMap~FrameState=} opt_frameState Frame state. + * @param {import("./PluggableMap.js").default} map Map. + * @param {?import("./PluggableMap.js").FrameState=} opt_frameState Frame state. */ constructor(type, map, opt_frameState) { @@ -21,14 +21,14 @@ class MapEvent extends Event { /** * The map where the event occurred. - * @type {module:ol/PluggableMap} + * @type {import("./PluggableMap.js").default} * @api */ this.map = map; /** * The frame state at the time of the event. - * @type {?module:ol/PluggableMap~FrameState} + * @type {?import("./PluggableMap.js").FrameState} * @api */ this.frameState = opt_frameState !== undefined ? opt_frameState : null; diff --git a/src/ol/Object.js b/src/ol/Object.js index 2683a2274c..719cf545f1 100644 --- a/src/ol/Object.js +++ b/src/ol/Object.js @@ -82,7 +82,7 @@ class ObjectEvent extends Event { * Properties can be deleted by using the unset method. E.g. * object.unset('foo'). * - * @fires module:ol/Object~ObjectEvent + * @fires ObjectEvent * @api */ class BaseObject extends Observable { diff --git a/src/ol/Observable.js b/src/ol/Observable.js index ae65118b85..098e284d88 100644 --- a/src/ol/Observable.js +++ b/src/ol/Observable.js @@ -13,7 +13,7 @@ import EventType from './events/EventType.js'; * and unregistration. A generic `change` event is always available through * {@link module:ol/Observable~Observable#changed}. * - * @fires module:ol/events/Event~Event + * @fires import("./events/Event.js").Event * @api */ class Observable extends EventTarget { @@ -52,7 +52,7 @@ class Observable extends EventTarget { * Listen for a certain type of event. * @param {string|Array} type The event type or array of event types. * @param {function(?): ?} listener The listener function. - * @return {module:ol/events~EventsKey|Array} Unique key for the listener. If + * @return {import("./events.js").EventsKey|Array} Unique key for the listener. If * called with an array of event types as the first argument, the return * will be an array of keys. * @api @@ -74,7 +74,7 @@ class Observable extends EventTarget { * Listen once for a certain type of event. * @param {string|Array} type The event type or array of event types. * @param {function(?): ?} listener The listener function. - * @return {module:ol/events~EventsKey|Array} Unique key for the listener. If + * @return {import("./events.js").EventsKey|Array} Unique key for the listener. If * called with an array of event types as the first argument, the return * will be an array of keys. * @api @@ -113,7 +113,7 @@ class Observable extends EventTarget { /** * Removes an event listener using the key returned by `on()` or `once()`. - * @param {module:ol/events~EventsKey|Array} key The key returned by `on()` + * @param {import("./events.js").EventsKey|Array} key The key returned by `on()` * or `once()` (or an array of keys). * @api */ @@ -123,7 +123,7 @@ export function unByKey(key) { unlistenByKey(key[i]); } } else { - unlistenByKey(/** @type {module:ol/events~EventsKey} */ (key)); + unlistenByKey(/** @type {import("./events.js").EventsKey} */ (key)); } } diff --git a/src/ol/Overlay.js b/src/ol/Overlay.js index e1516cf9d5..42843bbb86 100644 --- a/src/ol/Overlay.js +++ b/src/ol/Overlay.js @@ -20,9 +20,9 @@ import {containsExtent} from './extent.js'; * array is the horizontal offset. A positive value shifts the overlay right. * The second element in the array is the vertical offset. A positive value * shifts the overlay down. - * @property {module:ol/coordinate~Coordinate} [position] The overlay position + * @property {import("./coordinate.js").Coordinate} [position] The overlay position * in map projection. - * @property {module:ol/OverlayPositioning} [positioning='top-left'] Defines how + * @property {import("./OverlayPositioning.js").default} [positioning='top-left'] Defines how * the overlay is actually positioned with respect to its `position` property. * Possible values are `'bottom-left'`, `'bottom-center'`, `'bottom-right'`, * `'center-left'`, `'center-center'`, `'center-right'`, `'top-left'`, @@ -40,7 +40,7 @@ import {containsExtent} from './extent.js'; * @property {boolean} [autoPan=false] If set to `true` the map is panned when * calling `setPosition`, so that the overlay is entirely visible in the current * viewport. - * @property {module:ol/Overlay~PanOptions} [autoPanAnimation] The + * @property {PanOptions} [autoPanAnimation] The * animation options used to pan the overlay into view. This animation is only * used when `autoPan` is enabled. A `duration` and `easing` may be provided to * customize the animation. @@ -97,7 +97,7 @@ const Property = { class Overlay extends BaseObject { /** - * @param {module:ol/Overlay~Options} options Overlay options. + * @param {Options} options Overlay options. */ constructor(options) { @@ -105,7 +105,7 @@ class Overlay extends BaseObject { /** * @protected - * @type {module:ol/Overlay~Options} + * @type {Options} */ this.options = options; @@ -145,9 +145,9 @@ class Overlay extends BaseObject { /** * @protected - * @type {module:ol/Overlay~PanOptions} + * @type {PanOptions} */ - this.autoPanAnimation = options.autoPanAnimation || /** @type {module:ol/Overlay~PanOptions} */ ({}); + this.autoPanAnimation = options.autoPanAnimation || /** @type {PanOptions} */ ({}); /** * @protected @@ -174,7 +174,7 @@ class Overlay extends BaseObject { /** * @protected - * @type {?module:ol/events~EventsKey} + * @type {?import("./events.js").EventsKey} */ this.mapPostrenderListenerKey = null; @@ -205,7 +205,7 @@ class Overlay extends BaseObject { this.setOffset(options.offset !== undefined ? options.offset : [0, 0]); this.setPositioning(options.positioning !== undefined ? - /** @type {module:ol/OverlayPositioning} */ (options.positioning) : + /** @type {import("./OverlayPositioning.js").default} */ (options.positioning) : OverlayPositioning.TOP_LEFT); if (options.position !== undefined) { @@ -235,14 +235,14 @@ class Overlay extends BaseObject { /** * Get the map associated with this overlay. - * @return {module:ol/PluggableMap|undefined} The map that the + * @return {import("./PluggableMap.js").default|undefined} The map that the * overlay is part of. * @observable * @api */ getMap() { return ( - /** @type {module:ol/PluggableMap|undefined} */ (this.get(Property.MAP)) + /** @type {import("./PluggableMap.js").default|undefined} */ (this.get(Property.MAP)) ); } @@ -258,27 +258,27 @@ class Overlay extends BaseObject { /** * Get the current position of this overlay. - * @return {module:ol/coordinate~Coordinate|undefined} The spatial point that the overlay is + * @return {import("./coordinate.js").Coordinate|undefined} The spatial point that the overlay is * anchored at. * @observable * @api */ getPosition() { return ( - /** @type {module:ol/coordinate~Coordinate|undefined} */ (this.get(Property.POSITION)) + /** @type {import("./coordinate.js").Coordinate|undefined} */ (this.get(Property.POSITION)) ); } /** * Get the current positioning of this overlay. - * @return {module:ol/OverlayPositioning} How the overlay is positioned + * @return {import("./OverlayPositioning.js").default} How the overlay is positioned * relative to its point on the map. * @observable * @api */ getPositioning() { return ( - /** @type {module:ol/OverlayPositioning} */ (this.get(Property.POSITIONING)) + /** @type {import("./OverlayPositioning.js").default} */ (this.get(Property.POSITIONING)) ); } @@ -360,7 +360,7 @@ class Overlay extends BaseObject { /** * Set the map to be associated with this overlay. - * @param {module:ol/PluggableMap|undefined} map The map that the + * @param {import("./PluggableMap.js").default|undefined} map The map that the * overlay is part of. * @observable * @api @@ -382,7 +382,7 @@ class Overlay extends BaseObject { /** * Set the position for this overlay. If the position is `undefined` the * overlay is hidden. - * @param {module:ol/coordinate~Coordinate|undefined} position The spatial point that the overlay + * @param {import("./coordinate.js").Coordinate|undefined} position The spatial point that the overlay * is anchored at. * @observable * @api @@ -432,7 +432,7 @@ class Overlay extends BaseObject { } if (delta[0] !== 0 || delta[1] !== 0) { - const center = /** @type {module:ol/coordinate~Coordinate} */ (map.getView().getCenter()); + const center = /** @type {import("./coordinate.js").Coordinate} */ (map.getView().getCenter()); const centerPx = map.getPixelFromCoordinate(center); const newCenterPx = [ centerPx[0] + delta[0], @@ -451,8 +451,8 @@ class Overlay extends BaseObject { /** * Get the extent of an element relative to the document * @param {HTMLElement|undefined} element The element. - * @param {module:ol/size~Size|undefined} size The size of the element. - * @return {module:ol/extent~Extent} The extent. + * @param {import("./size.js").Size|undefined} size The size of the element. + * @return {import("./extent.js").Extent} The extent. * @protected */ getRect(element, size) { @@ -469,7 +469,7 @@ class Overlay extends BaseObject { /** * Set the positioning for this overlay. - * @param {module:ol/OverlayPositioning} positioning how the overlay is + * @param {import("./OverlayPositioning.js").default} positioning how the overlay is * positioned relative to its point on the map. * @observable * @api @@ -508,8 +508,8 @@ class Overlay extends BaseObject { } /** - * @param {module:ol/pixel~Pixel} pixel The pixel location. - * @param {module:ol/size~Size|undefined} mapSize The map size. + * @param {import("./pixel.js").Pixel} pixel The pixel location. + * @param {import("./size.js").Size|undefined} mapSize The map size. * @protected */ updateRenderedPosition(pixel, mapSize) { @@ -574,7 +574,7 @@ class Overlay extends BaseObject { /** * returns the options this Overlay has been created with - * @return {module:ol/Overlay~Options} overlay options + * @return {Options} overlay options */ getOptions() { return this.options; diff --git a/src/ol/PluggableMap.js b/src/ol/PluggableMap.js index 144c6e0aaf..96c9d82b0c 100644 --- a/src/ol/PluggableMap.js +++ b/src/ol/PluggableMap.js @@ -36,33 +36,33 @@ import {create as createTransform, apply as applyTransform} from './transform.js * @typedef {Object} FrameState * @property {number} pixelRatio The pixel ratio of the frame. * @property {number} time The time when rendering of the frame was requested. - * @property {module:ol/View~State} viewState The state of the current view. + * @property {import("./View.js").State} viewState The state of the current view. * @property {boolean} animate - * @property {module:ol/transform~Transform} coordinateToPixelTransform - * @property {null|module:ol/extent~Extent} extent - * @property {module:ol/coordinate~Coordinate} focus + * @property {import("./transform.js").Transform} coordinateToPixelTransform + * @property {null|import("./extent.js").Extent} extent + * @property {import("./coordinate.js").Coordinate} focus * @property {number} index - * @property {Object} layerStates - * @property {Array} layerStatesArray - * @property {module:ol/transform~Transform} pixelToCoordinateTransform - * @property {Array} postRenderFunctions - * @property {module:ol/size~Size} size + * @property {Object} layerStates + * @property {Array} layerStatesArray + * @property {import("./transform.js").Transform} pixelToCoordinateTransform + * @property {Array} postRenderFunctions + * @property {import("./size.js").Size} size * @property {!Object} skippedFeatureUids - * @property {module:ol/TileQueue} tileQueue - * @property {Object>} usedTiles + * @property {import("./TileQueue.js").default} tileQueue + * @property {Object>} usedTiles * @property {Array} viewHints * @property {!Object>} wantedTiles */ /** - * @typedef {function(module:ol/PluggableMap, ?module:ol/PluggableMap~FrameState): boolean} PostRenderFunction + * @typedef {function(import("./PluggableMap.js").default, ?FrameState): boolean} PostRenderFunction */ /** * @typedef {Object} AtPixelOptions - * @property {undefined|function(module:ol/layer/Layer): boolean} layerFilter Layer filter + * @property {undefined|function(import("./layer/Layer.js").default): boolean} layerFilter Layer filter * function. The filter function will receive one argument, the * {@link module:ol/layer/Layer layer-candidate} and it should return a boolean value. * Only layers which are visible and for which this function returns `true` @@ -75,10 +75,10 @@ import {create as createTransform, apply as applyTransform} from './transform.js /** * @typedef {Object} MapOptionsInternal - * @property {module:ol/Collection} [controls] - * @property {module:ol/Collection} [interactions] + * @property {import("./Collection.js").default} [controls] + * @property {import("./Collection.js").default} [interactions] * @property {HTMLElement|Document} keyboardEventTarget - * @property {module:ol/Collection} overlays + * @property {import("./Collection.js").default} overlays * @property {Object} values */ @@ -86,12 +86,12 @@ import {create as createTransform, apply as applyTransform} from './transform.js /** * Object literal with config options for the map. * @typedef {Object} MapOptions - * @property {module:ol/Collection|Array} [controls] + * @property {import("./Collection.js").default|Array} [controls] * Controls initially added to the map. If not specified, * {@link module:ol/control/util~defaults} is used. * @property {number} [pixelRatio=window.devicePixelRatio] The ratio between * physical pixels and device-independent pixels (dips) on the device. - * @property {module:ol/Collection|Array} [interactions] + * @property {import("./Collection.js").default|Array} [interactions] * Interactions that are initially added to the map. If not specified, * {@link module:ol/interaction~defaults} is used. * @property {HTMLElement|Document|string} [keyboardEventTarget] The element to @@ -102,7 +102,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js * map target (i.e. the user-provided div for the map). If this is not * `document`, the target element needs to be focused for key events to be * emitted, requiring that the target element has a `tabindex` attribute. - * @property {Array|module:ol/Collection} [layers] + * @property {Array|import("./Collection.js").default} [layers] * Layers. If this is not defined, a map with no layers will be rendered. Note * that layers are rendered in the order supplied, so if you want, for example, * a vector layer to appear on top of a tile layer, it must come after the tile @@ -119,21 +119,21 @@ import {create as createTransform, apply as applyTransform} from './transform.js * @property {number} [moveTolerance=1] The minimum distance in pixels the * cursor must move to be detected as a map move event instead of a click. * Increasing this value can make it easier to click on the map. - * @property {module:ol/Collection|Array} [overlays] + * @property {import("./Collection.js").default|Array} [overlays] * Overlays initially added to the map. By default, no overlays are added. * @property {HTMLElement|string} [target] The container for the map, either the * element itself or the `id` of the element. If not specified at construction * time, {@link module:ol/Map~Map#setTarget} must be called for the map to be * rendered. - * @property {module:ol/View} [view] The map's view. No layer sources will be + * @property {import("./View.js").default} [view] The map's view. No layer sources will be * fetched unless this is specified at construction time or through * {@link module:ol/Map~Map#setView}. */ /** - * @fires module:ol/MapBrowserEvent~MapBrowserEvent - * @fires module:ol/MapEvent~MapEvent + * @fires import("./MapBrowserEvent.js").MapBrowserEvent + * @fires import("./MapEvent.js").MapEvent * @fires module:ol/render/Event~RenderEvent#postcompose * @fires module:ol/render/Event~RenderEvent#precompose * @fires module:ol/render/Event~RenderEvent#rendercomplete @@ -142,7 +142,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js class PluggableMap extends BaseObject { /** - * @param {module:ol/PluggableMap~MapOptions} options Map options. + * @param {MapOptions} options Map options. */ constructor(options) { @@ -195,13 +195,13 @@ class PluggableMap extends BaseObject { /** * @private - * @type {module:ol/transform~Transform} + * @type {import("./transform.js").Transform} */ this.coordinateToPixelTransform_ = createTransform(); /** * @private - * @type {module:ol/transform~Transform} + * @type {import("./transform.js").Transform} */ this.pixelToCoordinateTransform_ = createTransform(); @@ -213,32 +213,32 @@ class PluggableMap extends BaseObject { /** * @private - * @type {?module:ol/PluggableMap~FrameState} + * @type {?FrameState} */ this.frameState_ = null; /** * The extent at the previous 'moveend' event. * @private - * @type {module:ol/extent~Extent} + * @type {import("./extent.js").Extent} */ this.previousExtent_ = null; /** * @private - * @type {?module:ol/events~EventsKey} + * @type {?import("./events.js").EventsKey} */ this.viewPropertyListenerKey_ = null; /** * @private - * @type {?module:ol/events~EventsKey} + * @type {?import("./events.js").EventsKey} */ this.viewChangeListenerKey_ = null; /** * @private - * @type {Array} + * @type {Array} */ this.layerGroupPropertyListenerKeys_ = null; @@ -287,7 +287,7 @@ class PluggableMap extends BaseObject { /** * @private - * @type {module:ol/MapBrowserEventHandler} + * @type {import("./MapBrowserEventHandler.js").default} */ this.mapBrowserEventHandler_ = new MapBrowserEventHandler(this, options.moveTolerance); for (const key in MapBrowserEventType) { @@ -303,7 +303,7 @@ class PluggableMap extends BaseObject { /** * @private - * @type {Array} + * @type {Array} */ this.keyHandlerKeys_ = null; @@ -312,19 +312,19 @@ class PluggableMap extends BaseObject { listen(this.viewport_, EventType.MOUSEWHEEL, this.handleBrowserEvent, this); /** - * @type {module:ol/Collection} + * @type {import("./Collection.js").default} * @protected */ this.controls = optionsInternal.controls || new Collection(); /** - * @type {module:ol/Collection} + * @type {import("./Collection.js").default} * @protected */ this.interactions = optionsInternal.interactions || new Collection(); /** - * @type {module:ol/Collection} + * @type {import("./Collection.js").default} * @private */ this.overlays_ = optionsInternal.overlays; @@ -332,12 +332,12 @@ class PluggableMap extends BaseObject { /** * A lookup of overlays by id. * @private - * @type {Object} + * @type {Object} */ this.overlayIdIndex_ = {}; /** - * @type {module:ol/renderer/Map} + * @type {import("./renderer/Map.js").default} * @private */ this.renderer_ = this.createRenderer(); @@ -350,19 +350,19 @@ class PluggableMap extends BaseObject { /** * @private - * @type {module:ol/coordinate~Coordinate} + * @type {import("./coordinate.js").Coordinate} */ this.focus_ = null; /** * @private - * @type {!Array} + * @type {!Array} */ this.postRenderFunctions_ = []; /** * @private - * @type {module:ol/TileQueue} + * @type {import("./TileQueue.js").default} */ this.tileQueue_ = new TileQueue( this.getTilePriority.bind(this), @@ -391,8 +391,8 @@ class PluggableMap extends BaseObject { this.controls.forEach( /** - * @param {module:ol/control/Control} control Control. - * @this {module:ol/PluggableMap} + * @param {import("./control/Control.js").default} control Control. + * @this {import("./PluggableMap.js").default} */ (function(control) { control.setMap(this); @@ -400,7 +400,7 @@ class PluggableMap extends BaseObject { listen(this.controls, CollectionEventType.ADD, /** - * @param {module:ol/Collection~CollectionEvent} event CollectionEvent. + * @param {import("./Collection.js").CollectionEvent} event CollectionEvent. */ function(event) { event.element.setMap(this); @@ -408,7 +408,7 @@ class PluggableMap extends BaseObject { listen(this.controls, CollectionEventType.REMOVE, /** - * @param {module:ol/Collection~CollectionEvent} event CollectionEvent. + * @param {import("./Collection.js").CollectionEvent} event CollectionEvent. */ function(event) { event.element.setMap(null); @@ -416,8 +416,8 @@ class PluggableMap extends BaseObject { this.interactions.forEach( /** - * @param {module:ol/interaction/Interaction} interaction Interaction. - * @this {module:ol/PluggableMap} + * @param {import("./interaction/Interaction.js").default} interaction Interaction. + * @this {import("./PluggableMap.js").default} */ (function(interaction) { interaction.setMap(this); @@ -425,7 +425,7 @@ class PluggableMap extends BaseObject { listen(this.interactions, CollectionEventType.ADD, /** - * @param {module:ol/Collection~CollectionEvent} event CollectionEvent. + * @param {import("./Collection.js").CollectionEvent} event CollectionEvent. */ function(event) { event.element.setMap(this); @@ -433,7 +433,7 @@ class PluggableMap extends BaseObject { listen(this.interactions, CollectionEventType.REMOVE, /** - * @param {module:ol/Collection~CollectionEvent} event CollectionEvent. + * @param {import("./Collection.js").CollectionEvent} event CollectionEvent. */ function(event) { event.element.setMap(null); @@ -443,18 +443,18 @@ class PluggableMap extends BaseObject { listen(this.overlays_, CollectionEventType.ADD, /** - * @param {module:ol/Collection~CollectionEvent} event CollectionEvent. + * @param {import("./Collection.js").CollectionEvent} event CollectionEvent. */ function(event) { - this.addOverlayInternal_(/** @type {module:ol/Overlay} */ (event.element)); + this.addOverlayInternal_(/** @type {import("./Overlay.js").default} */ (event.element)); }, this); listen(this.overlays_, CollectionEventType.REMOVE, /** - * @param {module:ol/Collection~CollectionEvent} event CollectionEvent. + * @param {import("./Collection.js").CollectionEvent} event CollectionEvent. */ function(event) { - const overlay = /** @type {module:ol/Overlay} */ (event.element); + const overlay = /** @type {import("./Overlay.js").default} */ (event.element); const id = overlay.getId(); if (id !== undefined) { delete this.overlayIdIndex_[id.toString()]; @@ -470,7 +470,7 @@ class PluggableMap extends BaseObject { /** * Add the given control to the map. - * @param {module:ol/control/Control} control Control. + * @param {import("./control/Control.js").default} control Control. * @api */ addControl(control) { @@ -479,7 +479,7 @@ class PluggableMap extends BaseObject { /** * Add the given interaction to the map. - * @param {module:ol/interaction/Interaction} interaction Interaction to add. + * @param {import("./interaction/Interaction.js").default} interaction Interaction to add. * @api */ addInteraction(interaction) { @@ -490,7 +490,7 @@ class PluggableMap extends BaseObject { * Adds the given layer to the top of this map. If you want to add a layer * elsewhere in the stack, use `getLayers()` and the methods available on * {@link module:ol/Collection~Collection}. - * @param {module:ol/layer/Base} layer Layer. + * @param {import("./layer/Base.js").default} layer Layer. * @api */ addLayer(layer) { @@ -500,7 +500,7 @@ class PluggableMap extends BaseObject { /** * Add the given overlay to the map. - * @param {module:ol/Overlay} overlay Overlay. + * @param {import("./Overlay.js").default} overlay Overlay. * @api */ addOverlay(overlay) { @@ -509,7 +509,7 @@ class PluggableMap extends BaseObject { /** * This deals with map's overlay collection changes. - * @param {module:ol/Overlay} overlay Overlay. + * @param {import("./Overlay.js").default} overlay Overlay. * @private */ addOverlayInternal_(overlay) { @@ -545,16 +545,16 @@ class PluggableMap extends BaseObject { * Detect features that intersect a pixel on the viewport, and execute a * callback with each intersecting feature. Layers included in the detection can * be configured through the `layerFilter` option in `opt_options`. - * @param {module:ol/pixel~Pixel} pixel Pixel. - * @param {function(this: S, (module:ol/Feature|module:ol/render/Feature), - * module:ol/layer/Layer): T} callback Feature callback. The callback will be + * @param {import("./pixel.js").Pixel} pixel Pixel. + * @param {function(this: S, (import("./Feature.js").default|import("./render/Feature.js").default), + * import("./layer/Layer.js").default): T} callback Feature callback. The callback will be * called with two arguments. The first argument is one * {@link module:ol/Feature feature} or * {@link module:ol/render/Feature render feature} at the pixel, the second is * the {@link module:ol/layer/Layer layer} of the feature and will be null for * unmanaged layers. To stop detection, callback functions can return a * truthy value. - * @param {module:ol/PluggableMap~AtPixelOptions=} opt_options Optional options. + * @param {AtPixelOptions=} opt_options Optional options. * @return {T|undefined} Callback result, i.e. the return value of last * callback execution, or the first truthy callback return value. * @template S,T @@ -577,9 +577,9 @@ class PluggableMap extends BaseObject { /** * Get all features that intersect a pixel on the viewport. - * @param {module:ol/pixel~Pixel} pixel Pixel. - * @param {module:ol/PluggableMap~AtPixelOptions=} opt_options Optional options. - * @return {Array} The detected features or + * @param {import("./pixel.js").Pixel} pixel Pixel. + * @param {AtPixelOptions=} opt_options Optional options. + * @return {Array} The detected features or * `null` if none were found. * @api */ @@ -598,14 +598,14 @@ class PluggableMap extends BaseObject { * Detect layers that have a color value at a pixel on the viewport, and * execute a callback with each matching layer. Layers included in the * detection can be configured through `opt_layerFilter`. - * @param {module:ol/pixel~Pixel} pixel Pixel. - * @param {function(this: S, module:ol/layer/Layer, (Uint8ClampedArray|Uint8Array)): T} callback + * @param {import("./pixel.js").Pixel} pixel Pixel. + * @param {function(this: S, import("./layer/Layer.js").default, (Uint8ClampedArray|Uint8Array)): T} callback * Layer callback. This callback will receive two arguments: first is the * {@link module:ol/layer/Layer layer}, second argument is an array representing * [R, G, B, A] pixel values (0 - 255) and will be `null` for layer types * that do not currently support this argument. To stop detection, callback * functions can return a truthy value. - * @param {module:ol/PluggableMap~AtPixelOptions=} opt_options Configuration options. + * @param {AtPixelOptions=} opt_options Configuration options. * @return {T|undefined} Callback result, i.e. the return value of last * callback execution, or the first truthy callback return value. * @template S,T @@ -615,7 +615,7 @@ class PluggableMap extends BaseObject { if (!this.frameState_) { return; } - const options = opt_options || /** @type {module:ol/PluggableMap~AtPixelOptions} */ ({}); + const options = opt_options || /** @type {AtPixelOptions} */ ({}); const hitTolerance = options.hitTolerance !== undefined ? opt_options.hitTolerance * this.frameState_.pixelRatio : 0; const layerFilter = options.layerFilter || TRUE; @@ -626,8 +626,8 @@ class PluggableMap extends BaseObject { /** * Detect if features intersect a pixel on the viewport. Layers included in the * detection can be configured through `opt_layerFilter`. - * @param {module:ol/pixel~Pixel} pixel Pixel. - * @param {module:ol/PluggableMap~AtPixelOptions=} opt_options Optional options. + * @param {import("./pixel.js").Pixel} pixel Pixel. + * @param {AtPixelOptions=} opt_options Optional options. * @return {boolean} Is there a feature at the given pixel? * @template U * @api @@ -648,7 +648,7 @@ class PluggableMap extends BaseObject { /** * Returns the coordinate in view projection for a browser event. * @param {Event} event Event. - * @return {module:ol/coordinate~Coordinate} Coordinate. + * @return {import("./coordinate.js").Coordinate} Coordinate. * @api */ getEventCoordinate(event) { @@ -658,7 +658,7 @@ class PluggableMap extends BaseObject { /** * Returns the map pixel position for a browser event relative to the viewport. * @param {Event} event Event. - * @return {module:ol/pixel~Pixel} Pixel. + * @return {import("./pixel.js").Pixel} Pixel. * @api */ getEventPixel(event) { @@ -702,8 +702,8 @@ class PluggableMap extends BaseObject { /** * Get the coordinate for a given pixel. This returns a coordinate in the * map view projection. - * @param {module:ol/pixel~Pixel} pixel Pixel position in the map viewport. - * @return {module:ol/coordinate~Coordinate} The coordinate for the pixel position. + * @param {import("./pixel.js").Pixel} pixel Pixel position in the map viewport. + * @return {import("./coordinate.js").Coordinate} The coordinate for the pixel position. * @api */ getCoordinateFromPixel(pixel) { @@ -718,7 +718,7 @@ class PluggableMap extends BaseObject { /** * Get the map controls. Modifying this collection changes the controls * associated with the map. - * @return {module:ol/Collection} Controls. + * @return {import("./Collection.js").default} Controls. * @api */ getControls() { @@ -728,7 +728,7 @@ class PluggableMap extends BaseObject { /** * Get the map overlays. Modifying this collection changes the overlays * associated with the map. - * @return {module:ol/Collection} Overlays. + * @return {import("./Collection.js").default} Overlays. * @api */ getOverlays() { @@ -740,7 +740,7 @@ class PluggableMap extends BaseObject { * Note that the index treats string and numeric identifiers as the same. So * `map.getOverlayById(2)` will return an overlay with id `'2'` or `2`. * @param {string|number} id Overlay identifier. - * @return {module:ol/Overlay} Overlay. + * @return {import("./Overlay.js").default} Overlay. * @api */ getOverlayById(id) { @@ -753,7 +753,7 @@ class PluggableMap extends BaseObject { * associated with the map. * * Interactions are used for e.g. pan, zoom and rotate. - * @return {module:ol/Collection} Interactions. + * @return {import("./Collection.js").default} Interactions. * @api */ getInteractions() { @@ -762,19 +762,19 @@ class PluggableMap extends BaseObject { /** * Get the layergroup associated with this map. - * @return {module:ol/layer/Group} A layer group containing the layers in this map. + * @return {import("./layer/Group.js").default} A layer group containing the layers in this map. * @observable * @api */ getLayerGroup() { return ( - /** @type {module:ol/layer/Group} */ (this.get(MapProperty.LAYERGROUP)) + /** @type {import("./layer/Group.js").default} */ (this.get(MapProperty.LAYERGROUP)) ); } /** * Get the collection of layers associated with this map. - * @return {!module:ol/Collection} Layers. + * @return {!import("./Collection.js").default} Layers. * @api */ getLayers() { @@ -785,8 +785,8 @@ class PluggableMap extends BaseObject { /** * Get the pixel for a coordinate. This takes a coordinate in the map view * projection and returns the corresponding pixel. - * @param {module:ol/coordinate~Coordinate} coordinate A map coordinate. - * @return {module:ol/pixel~Pixel} A pixel position in the map viewport. + * @param {import("./coordinate.js").Coordinate} coordinate A map coordinate. + * @return {import("./pixel.js").Pixel} A pixel position in the map viewport. * @api */ getPixelFromCoordinate(coordinate) { @@ -800,7 +800,7 @@ class PluggableMap extends BaseObject { /** * Get the map renderer. - * @return {module:ol/renderer/Map} Renderer + * @return {import("./renderer/Map.js").default} Renderer */ getRenderer() { return this.renderer_; @@ -808,26 +808,26 @@ class PluggableMap extends BaseObject { /** * Get the size of this map. - * @return {module:ol/size~Size|undefined} The size in pixels of the map in the DOM. + * @return {import("./size.js").Size|undefined} The size in pixels of the map in the DOM. * @observable * @api */ getSize() { return ( - /** @type {module:ol/size~Size|undefined} */ (this.get(MapProperty.SIZE)) + /** @type {import("./size.js").Size|undefined} */ (this.get(MapProperty.SIZE)) ); } /** * Get the view associated with this map. A view manages properties such as * center and resolution. - * @return {module:ol/View} The view that controls this map. + * @return {import("./View.js").default} The view that controls this map. * @observable * @api */ getView() { return ( - /** @type {module:ol/View} */ (this.get(MapProperty.VIEW)) + /** @type {import("./View.js").default} */ (this.get(MapProperty.VIEW)) ); } @@ -863,9 +863,9 @@ class PluggableMap extends BaseObject { } /** - * @param {module:ol/Tile} tile Tile. + * @param {import("./Tile.js").default} tile Tile. * @param {string} tileSourceKey Tile source key. - * @param {module:ol/coordinate~Coordinate} tileCenter Tile center. + * @param {import("./coordinate.js").Coordinate} tileCenter Tile center. * @param {number} tileResolution Tile resolution. * @return {number} Tile priority. */ @@ -902,7 +902,7 @@ class PluggableMap extends BaseObject { } /** - * @param {module:ol/MapBrowserEvent} mapBrowserEvent The event to handle. + * @param {import("./MapBrowserEvent.js").default} mapBrowserEvent The event to handle. */ handleMapBrowserEvent(mapBrowserEvent) { if (!this.frameState_) { @@ -1122,8 +1122,8 @@ class PluggableMap extends BaseObject { /** * Remove the given control from the map. - * @param {module:ol/control/Control} control Control. - * @return {module:ol/control/Control|undefined} The removed control (or undefined + * @param {import("./control/Control.js").default} control Control. + * @return {import("./control/Control.js").default|undefined} The removed control (or undefined * if the control was not found). * @api */ @@ -1133,8 +1133,8 @@ class PluggableMap extends BaseObject { /** * Remove the given interaction from the map. - * @param {module:ol/interaction/Interaction} interaction Interaction to remove. - * @return {module:ol/interaction/Interaction|undefined} The removed interaction (or + * @param {import("./interaction/Interaction.js").default} interaction Interaction to remove. + * @return {import("./interaction/Interaction.js").default|undefined} The removed interaction (or * undefined if the interaction was not found). * @api */ @@ -1144,8 +1144,8 @@ class PluggableMap extends BaseObject { /** * Removes the given layer from the map. - * @param {module:ol/layer/Base} layer Layer. - * @return {module:ol/layer/Base|undefined} The removed layer (or undefined if the + * @param {import("./layer/Base.js").default} layer Layer. + * @return {import("./layer/Base.js").default|undefined} The removed layer (or undefined if the * layer was not found). * @api */ @@ -1156,8 +1156,8 @@ class PluggableMap extends BaseObject { /** * Remove the given overlay from the map. - * @param {module:ol/Overlay} overlay Overlay. - * @return {module:ol/Overlay|undefined} The removed overlay (or undefined + * @param {import("./Overlay.js").default} overlay Overlay. + * @return {import("./Overlay.js").default|undefined} The removed overlay (or undefined * if the overlay was not found). * @api */ @@ -1176,7 +1176,7 @@ class PluggableMap extends BaseObject { const view = this.getView(); const extent = createEmpty(); const previousFrameState = this.frameState_; - /** @type {?module:ol/PluggableMap~FrameState} */ + /** @type {?FrameState} */ let frameState = null; if (size !== undefined && hasArea(size) && view && view.isDef()) { const viewHints = view.getHints(this.frameState_ ? this.frameState_.viewHints : undefined); @@ -1186,7 +1186,7 @@ class PluggableMap extends BaseObject { layerStates[getUid(layerStatesArray[i].layer)] = layerStatesArray[i]; } viewState = view.getState(this.pixelRatio_); - frameState = /** @type {module:ol/PluggableMap~FrameState} */ ({ + frameState = /** @type {FrameState} */ ({ animate: false, coordinateToPixelTransform: this.coordinateToPixelTransform_, extent: extent, @@ -1252,7 +1252,7 @@ class PluggableMap extends BaseObject { /** * Sets the layergroup of this map. - * @param {module:ol/layer/Group} layerGroup A layer group containing the layers in this map. + * @param {import("./layer/Group.js").default} layerGroup A layer group containing the layers in this map. * @observable * @api */ @@ -1262,7 +1262,7 @@ class PluggableMap extends BaseObject { /** * Set the size of this map. - * @param {module:ol/size~Size|undefined} size The size in pixels of the map in the DOM. + * @param {import("./size.js").Size|undefined} size The size in pixels of the map in the DOM. * @observable * @api */ @@ -1283,7 +1283,7 @@ class PluggableMap extends BaseObject { /** * Set the view for this map. - * @param {module:ol/View} view The view that controls this map. + * @param {import("./View.js").default} view The view that controls this map. * @observable * @api */ @@ -1292,7 +1292,7 @@ class PluggableMap extends BaseObject { } /** - * @param {module:ol/Feature} feature Feature. + * @param {import("./Feature.js").default} feature Feature. */ skipFeature(feature) { const featureUid = getUid(feature).toString(); @@ -1328,7 +1328,7 @@ class PluggableMap extends BaseObject { } /** - * @param {module:ol/Feature} feature Feature. + * @param {import("./Feature.js").default} feature Feature. */ unskipFeature(feature) { const featureUid = getUid(feature).toString(); @@ -1340,7 +1340,7 @@ class PluggableMap extends BaseObject { /** * @param {MapOptions} options Map options. - * @return {module:ol/PluggableMap~MapOptionsInternal} Internal map options. + * @return {MapOptionsInternal} Internal map options. */ function createOptionsInternal(options) { @@ -1374,7 +1374,7 @@ function createOptionsInternal(options) { controls = new Collection(options.controls.slice()); } else { assert(options.controls instanceof Collection, - 47); // Expected `controls` to be an array or an `module:ol/Collection~Collection` + 47); // Expected `controls` to be an array or an `import("./Collection.js").Collection` controls = options.controls; } } @@ -1385,7 +1385,7 @@ function createOptionsInternal(options) { interactions = new Collection(options.interactions.slice()); } else { assert(options.interactions instanceof Collection, - 48); // Expected `interactions` to be an array or an `module:ol/Collection~Collection` + 48); // Expected `interactions` to be an array or an `import("./Collection.js").Collection` interactions = options.interactions; } } @@ -1396,7 +1396,7 @@ function createOptionsInternal(options) { overlays = new Collection(options.overlays.slice()); } else { assert(options.overlays instanceof Collection, - 49); // Expected `overlays` to be an array or an `module:ol/Collection~Collection` + 49); // Expected `overlays` to be an array or an `import("./Collection.js").Collection` overlays = options.overlays; } } else { @@ -1415,7 +1415,7 @@ function createOptionsInternal(options) { export default PluggableMap; /** - * @param {Array} layers Layers. + * @param {Array} layers Layers. * @return {boolean} Layers have sources that are still loading. */ function getLoading(layers) { diff --git a/src/ol/Tile.js b/src/ol/Tile.js index e5947ecf9a..8065d0227d 100644 --- a/src/ol/Tile.js +++ b/src/ol/Tile.js @@ -40,7 +40,7 @@ import EventType from './events/EventType.js'; * }); * ``` * - * @typedef {function(module:ol/Tile, string)} LoadFunction + * @typedef {function(import("./Tile.js").default, string)} LoadFunction * @api */ @@ -54,8 +54,8 @@ import EventType from './events/EventType.js'; * and returns a `{string}` representing the tile URL, or undefined if no tile * should be requested for the passed tile coordinate. * - * @typedef {function(module:ol/tilecoord~TileCoord, number, - * module:ol/proj/Projection): (string|undefined)} UrlFunction + * @typedef {function(import("./tilecoord.js").TileCoord, number, + * import("./proj/Projection.js").default): (string|undefined)} UrlFunction * @api */ @@ -77,9 +77,9 @@ import EventType from './events/EventType.js'; class Tile extends EventTarget { /** - * @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate. - * @param {module:ol/TileState} state State. - * @param {module:ol/Tile~Options=} opt_options Tile options. + * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate. + * @param {import("./TileState.js").default} state State. + * @param {Options=} opt_options Tile options. */ constructor(tileCoord, state, opt_options) { super(); @@ -87,13 +87,13 @@ class Tile extends EventTarget { const options = opt_options ? opt_options : {}; /** - * @type {module:ol/tilecoord~TileCoord} + * @type {import("./tilecoord.js").TileCoord} */ this.tileCoord = tileCoord; /** * @protected - * @type {module:ol/TileState} + * @type {import("./TileState.js").default} */ this.state = state; @@ -101,7 +101,7 @@ class Tile extends EventTarget { * An "interim" tile for this tile. The interim tile may be used while this * one is loading, for "smooth" transitions when changing params/dimensions * on the source. - * @type {module:ol/Tile} + * @type {import("./Tile.js").default} */ this.interimTile = null; @@ -146,7 +146,7 @@ class Tile extends EventTarget { * Get the interim tile most suitable for rendering using the chain of interim * tiles. This corresponds to the most recent tile that has been loaded, if no * such tile exists, the original tile is returned. - * @return {!module:ol/Tile} Best tile for rendering. + * @return {!import("./Tile.js").default} Best tile for rendering. */ getInterimTile() { if (!this.interimTile) { @@ -206,7 +206,7 @@ class Tile extends EventTarget { /** * Get the tile coordinate for this tile. - * @return {module:ol/tilecoord~TileCoord} The tile coordinate. + * @return {import("./tilecoord.js").TileCoord} The tile coordinate. * @api */ getTileCoord() { @@ -214,7 +214,7 @@ class Tile extends EventTarget { } /** - * @return {module:ol/TileState} State. + * @return {import("./TileState.js").default} State. */ getState() { return this.state; @@ -225,7 +225,7 @@ class Tile extends EventTarget { * it is important to set the state correctly to {@link module:ol/TileState~ERROR} * when the tile cannot be loaded. Otherwise the tile cannot be removed from * the tile queue and will block other requests. - * @param {module:ol/TileState} state State. + * @param {import("./TileState.js").default} state State. * @api */ setState(state) { diff --git a/src/ol/TileCache.js b/src/ol/TileCache.js index 5c0131e9da..54b0cb4fd6 100644 --- a/src/ol/TileCache.js +++ b/src/ol/TileCache.js @@ -16,7 +16,7 @@ class TileCache extends LRUCache { } /** - * @param {!Object} usedTiles Used tiles. + * @param {!Object} usedTiles Used tiles. */ expireCache(usedTiles) { while (this.canExpireCache()) { diff --git a/src/ol/TileQueue.js b/src/ol/TileQueue.js index dddcdcdfc3..fbce910fcd 100644 --- a/src/ol/TileQueue.js +++ b/src/ol/TileQueue.js @@ -8,14 +8,14 @@ import PriorityQueue from './structs/PriorityQueue.js'; /** - * @typedef {function(module:ol/Tile, string, module:ol/coordinate~Coordinate, number): number} PriorityFunction + * @typedef {function(import("./Tile.js").default, string, import("./coordinate.js").Coordinate, number): number} PriorityFunction */ class TileQueue extends PriorityQueue { /** - * @param {module:ol/TileQueue~PriorityFunction} tilePriorityFunction Tile priority function. + * @param {PriorityFunction} tilePriorityFunction Tile priority function. * @param {function(): ?} tileChangeCallback Function called on each tile change event. */ constructor(tilePriorityFunction, tileChangeCallback) { @@ -33,7 +33,7 @@ class TileQueue extends PriorityQueue { * @return {string} Key. */ function(element) { - return (/** @type {module:ol/Tile} */ (element[0]).getKey()); + return (/** @type {import("./Tile.js").default} */ (element[0]).getKey()); }); /** @@ -76,11 +76,11 @@ class TileQueue extends PriorityQueue { } /** - * @param {module:ol/events/Event} event Event. + * @param {import("./events/Event.js").default} event Event. * @protected */ handleTileChange(event) { - const tile = /** @type {module:ol/Tile} */ (event.target); + const tile = /** @type {import("./Tile.js").default} */ (event.target); const state = tile.getState(); if (state === TileState.LOADED || state === TileState.ERROR || state === TileState.EMPTY || state === TileState.ABORT) { @@ -104,7 +104,7 @@ class TileQueue extends PriorityQueue { let state, tile, tileKey; while (this.tilesLoading_ < maxTotalLoading && newLoads < maxNewLoads && this.getCount() > 0) { - tile = /** @type {module:ol/Tile} */ (this.dequeue()[0]); + tile = /** @type {import("./Tile.js").default} */ (this.dequeue()[0]); tileKey = tile.getKey(); state = tile.getState(); if (state === TileState.ABORT) { diff --git a/src/ol/TileRange.js b/src/ol/TileRange.js index 006b38cad3..c7bb1bc885 100644 --- a/src/ol/TileRange.js +++ b/src/ol/TileRange.js @@ -39,7 +39,7 @@ class TileRange { } /** - * @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate. + * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate. * @return {boolean} Contains tile coordinate. */ contains(tileCoord) { @@ -47,7 +47,7 @@ class TileRange { } /** - * @param {module:ol/TileRange} tileRange Tile range. + * @param {import("./TileRange.js").default} tileRange Tile range. * @return {boolean} Contains. */ containsTileRange(tileRange) { @@ -65,7 +65,7 @@ class TileRange { } /** - * @param {module:ol/TileRange} tileRange Tile range. + * @param {import("./TileRange.js").default} tileRange Tile range. * @return {boolean} Equals. */ equals(tileRange) { @@ -74,7 +74,7 @@ class TileRange { } /** - * @param {module:ol/TileRange} tileRange Tile range. + * @param {import("./TileRange.js").default} tileRange Tile range. */ extend(tileRange) { if (tileRange.minX < this.minX) { @@ -99,7 +99,7 @@ class TileRange { } /** - * @return {module:ol/size~Size} Size. + * @return {import("./size.js").Size} Size. */ getSize() { return [this.getWidth(), this.getHeight()]; @@ -113,7 +113,7 @@ class TileRange { } /** - * @param {module:ol/TileRange} tileRange Tile range. + * @param {import("./TileRange.js").default} tileRange Tile range. * @return {boolean} Intersects. */ intersects(tileRange) { @@ -130,8 +130,8 @@ class TileRange { * @param {number} maxX Maximum X. * @param {number} minY Minimum Y. * @param {number} maxY Maximum Y. - * @param {module:ol/TileRange=} tileRange TileRange. - * @return {module:ol/TileRange} Tile range. + * @param {import("./TileRange.js").default=} tileRange TileRange. + * @return {import("./TileRange.js").default} Tile range. */ export function createOrUpdate(minX, maxX, minY, maxY, tileRange) { if (tileRange !== undefined) { diff --git a/src/ol/VectorImageTile.js b/src/ol/VectorImageTile.js index 3647a2e45c..523b0b966b 100644 --- a/src/ol/VectorImageTile.js +++ b/src/ol/VectorImageTile.js @@ -15,7 +15,7 @@ import {VOID} from './functions.js'; /** * @typedef {Object} ReplayState * @property {boolean} dirty - * @property {null|module:ol/render~OrderFunction} renderedRenderOrder + * @property {null|import("./render.js").OrderFunction} renderedRenderOrder * @property {number} renderedTileRevision * @property {number} renderedRevision */ @@ -24,22 +24,22 @@ import {VOID} from './functions.js'; class VectorImageTile extends Tile { /** - * @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate. - * @param {module:ol/TileState} state State. + * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate. + * @param {import("./TileState.js").default} state State. * @param {number} sourceRevision Source revision. - * @param {module:ol/format/Feature} format Feature format. - * @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function. - * @param {module:ol/tilecoord~TileCoord} urlTileCoord Wrapped tile coordinate for source urls. - * @param {module:ol/Tile~UrlFunction} tileUrlFunction Tile url function. - * @param {module:ol/tilegrid/TileGrid} sourceTileGrid Tile grid of the source. - * @param {module:ol/tilegrid/TileGrid} tileGrid Tile grid of the renderer. - * @param {Object} sourceTiles Source tiles. + * @param {import("./format/Feature.js").default} format Feature format. + * @param {import("./Tile.js").LoadFunction} tileLoadFunction Tile load function. + * @param {import("./tilecoord.js").TileCoord} urlTileCoord Wrapped tile coordinate for source urls. + * @param {import("./Tile.js").UrlFunction} tileUrlFunction Tile url function. + * @param {import("./tilegrid/TileGrid.js").default} sourceTileGrid Tile grid of the source. + * @param {import("./tilegrid/TileGrid.js").default} tileGrid Tile grid of the renderer. + * @param {Object} sourceTiles Source tiles. * @param {number} pixelRatio Pixel ratio. - * @param {module:ol/proj/Projection} projection Projection. - * @param {function(new: module:ol/VectorTile, module:ol/tilecoord~TileCoord, module:ol/TileState, string, - * module:ol/format/Feature, module:ol/Tile~LoadFunction)} tileClass Class to + * @param {import("./proj/Projection.js").default} projection Projection. + * @param {function(new: import("./VectorTile.js").default, import("./tilecoord.js").TileCoord, import("./TileState.js").default, string, + * import("./format/Feature.js").default, import("./Tile.js").LoadFunction)} tileClass Class to * instantiate for source tiles. - * @param {function(this: module:ol/source/VectorTile, module:ol/events/Event)} handleTileChange + * @param {function(this: import("./source/VectorTile.js").default, import("./events/Event.js").default)} handleTileChange * Function to call when a source tile's state changes. * @param {number} zoom Integer zoom to render the tile for. */ @@ -57,19 +57,19 @@ class VectorImageTile extends Tile { /** * @private - * @type {module:ol/featureloader~FeatureLoader} + * @type {import("./featureloader.js").FeatureLoader} */ this.loader_; /** * @private - * @type {!Object} + * @type {!Object} */ this.replayState_ = {}; /** * @private - * @type {Object} + * @type {Object} */ this.sourceTiles_ = sourceTiles; @@ -80,7 +80,7 @@ class VectorImageTile extends Tile { this.tileKeys = []; /** - * @type {module:ol/extent~Extent} + * @type {import("./extent.js").Extent} */ this.extent = null; @@ -90,17 +90,17 @@ class VectorImageTile extends Tile { this.sourceRevision_ = sourceRevision; /** - * @type {module:ol/tilecoord~TileCoord} + * @type {import("./tilecoord.js").TileCoord} */ this.wrappedTileCoord = urlTileCoord; /** - * @type {Array} + * @type {Array} */ this.loadListenerKeys_ = []; /** - * @type {Array} + * @type {Array} */ this.sourceTileListenerKeys_ = []; @@ -188,7 +188,7 @@ class VectorImageTile extends Tile { } /** - * @param {module:ol/layer/Layer} layer Layer. + * @param {import("./layer/Layer.js").default} layer Layer. * @return {CanvasRenderingContext2D} The rendering context. */ getContext(layer) { @@ -201,7 +201,7 @@ class VectorImageTile extends Tile { /** * Get the Canvas for this tile. - * @param {module:ol/layer/Layer} layer Layer. + * @param {import("./layer/Layer.js").default} layer Layer. * @return {HTMLCanvasElement} Canvas. */ getImage(layer) { @@ -210,8 +210,8 @@ class VectorImageTile extends Tile { } /** - * @param {module:ol/layer/Layer} layer Layer. - * @return {module:ol/VectorImageTile~ReplayState} The replay state. + * @param {import("./layer/Layer.js").default} layer Layer. + * @return {ReplayState} The replay state. */ getReplayState(layer) { const key = getUid(layer).toString(); @@ -235,7 +235,7 @@ class VectorImageTile extends Tile { /** * @param {string} tileKey Key (tileCoord) of the source tile. - * @return {module:ol/VectorTile} Source tile. + * @return {import("./VectorTile.js").default} Source tile. */ getTile(tileKey) { return this.sourceTiles_[tileKey]; @@ -319,7 +319,7 @@ export default VectorImageTile; /** * Sets the loader for a tile. - * @param {module:ol/VectorTile} tile Vector tile. + * @param {import("./VectorTile.js").default} tile Vector tile. * @param {string} url URL. */ export function defaultLoadFunction(tile, url) { diff --git a/src/ol/VectorTile.js b/src/ol/VectorTile.js index 438a27b427..322b4d82dc 100644 --- a/src/ol/VectorTile.js +++ b/src/ol/VectorTile.js @@ -7,26 +7,26 @@ import TileState from './TileState.js'; /** * @const - * @type {module:ol/extent~Extent} + * @type {import("./extent.js").Extent} */ const DEFAULT_EXTENT = [0, 0, 4096, 4096]; /** - * @typedef {function(new: module:ol/VectorTile, module:ol/tilecoord~TileCoord, - * module:ol/TileState, string, ?string, module:ol/Tile~LoadFunction)} TileClass + * @typedef {function(new: import("./VectorTile.js").default, import("./tilecoord.js").TileCoord, + * import("./TileState.js").default, string, ?string, import("./Tile.js").LoadFunction)} TileClass * @api */ class VectorTile extends Tile { /** - * @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate. - * @param {module:ol/TileState} state State. + * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate. + * @param {import("./TileState.js").default} state State. * @param {string} src Data source url. - * @param {module:ol/format/Feature} format Feature format. - * @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function. - * @param {module:ol/Tile~Options=} opt_options Tile options. + * @param {import("./format/Feature.js").default} format Feature format. + * @param {import("./Tile.js").LoadFunction} tileLoadFunction Tile load function. + * @param {import("./Tile.js").Options=} opt_options Tile options. */ constructor(tileCoord, state, src, format, tileLoadFunction, opt_options) { @@ -39,44 +39,44 @@ class VectorTile extends Tile { /** * @private - * @type {module:ol/extent~Extent} + * @type {import("./extent.js").Extent} */ this.extent_ = null; /** * @private - * @type {module:ol/format/Feature} + * @type {import("./format/Feature.js").default} */ this.format_ = format; /** * @private - * @type {Array} + * @type {Array} */ this.features_ = null; /** * @private - * @type {module:ol/featureloader~FeatureLoader} + * @type {import("./featureloader.js").FeatureLoader} */ this.loader_; /** * Data projection * @private - * @type {module:ol/proj/Projection} + * @type {import("./proj/Projection.js").default} */ this.projection_ = null; /** * @private - * @type {Object} + * @type {Object} */ this.replayGroups_ = {}; /** * @private - * @type {module:ol/Tile~LoadFunction} + * @type {import("./Tile.js").LoadFunction} */ this.tileLoadFunction_ = tileLoadFunction; @@ -101,7 +101,7 @@ class VectorTile extends Tile { /** * Gets the extent of the vector tile. - * @return {module:ol/extent~Extent} The extent. + * @return {import("./extent.js").Extent} The extent. * @api */ getExtent() { @@ -110,7 +110,7 @@ class VectorTile extends Tile { /** * Get the feature format assigned for reading this tile's features. - * @return {module:ol/format/Feature} Feature format. + * @return {import("./format/Feature.js").default} Feature format. * @api */ getFormat() { @@ -120,7 +120,7 @@ class VectorTile extends Tile { /** * Get the features for this tile. Geometries will be in the projection returned * by {@link module:ol/VectorTile~VectorTile#getProjection}. - * @return {Array} Features. + * @return {Array} Features. * @api */ getFeatures() { @@ -137,7 +137,7 @@ class VectorTile extends Tile { /** * Get the feature projection of features returned by * {@link module:ol/VectorTile~VectorTile#getFeatures}. - * @return {module:ol/proj/Projection} Feature projection. + * @return {import("./proj/Projection.js").default} Feature projection. * @api */ getProjection() { @@ -145,9 +145,9 @@ class VectorTile extends Tile { } /** - * @param {module:ol/layer/Layer} layer Layer. + * @param {import("./layer/Layer.js").default} layer Layer. * @param {string} key Key. - * @return {module:ol/render/ReplayGroup} Replay group. + * @return {import("./render/ReplayGroup.js").default} Replay group. */ getReplayGroup(layer, key) { return this.replayGroups_[getUid(layer) + ',' + key]; @@ -166,9 +166,9 @@ class VectorTile extends Tile { /** * 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. + * @param {Array} features The loaded features. + * @param {import("./proj/Projection.js").default} dataProjection Data projection. + * @param {import("./extent.js").Extent} extent Extent. */ onLoad(features, dataProjection, extent) { this.setProjection(dataProjection); @@ -192,7 +192,7 @@ class VectorTile extends Tile { * 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. + * @param {import("./extent.js").Extent} extent The extent. * @api */ setExtent(extent) { @@ -202,7 +202,7 @@ class VectorTile extends Tile { /** * Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`. * Sets the features for the tile. - * @param {Array} features Features. + * @param {Array} features Features. * @api */ setFeatures(features) { @@ -214,7 +214,7 @@ class VectorTile extends Tile { * 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. + * @param {import("./proj/Projection.js").default} projection Feature projection. * @api */ setProjection(projection) { @@ -222,9 +222,9 @@ class VectorTile extends Tile { } /** - * @param {module:ol/layer/Layer} layer Layer. + * @param {import("./layer/Layer.js").default} layer Layer. * @param {string} key Key. - * @param {module:ol/render/ReplayGroup} replayGroup Replay group. + * @param {import("./render/ReplayGroup.js").default} replayGroup Replay group. */ setReplayGroup(layer, key, replayGroup) { this.replayGroups_[getUid(layer) + ',' + key] = replayGroup; @@ -232,7 +232,7 @@ class VectorTile extends Tile { /** * Set the feature loader for reading this tile's features. - * @param {module:ol/featureloader~FeatureLoader} loader Feature loader. + * @param {import("./featureloader.js").FeatureLoader} loader Feature loader. * @api */ setLoader(loader) { diff --git a/src/ol/View.js b/src/ol/View.js index bfa03058a8..21e2976b5b 100644 --- a/src/ol/View.js +++ b/src/ol/View.js @@ -28,13 +28,13 @@ import Units from './proj/Units.js'; * An animation configuration * * @typedef {Object} Animation - * @property {module:ol/coordinate~Coordinate} [sourceCenter] - * @property {module:ol/coordinate~Coordinate} [targetCenter] + * @property {import("./coordinate.js").Coordinate} [sourceCenter] + * @property {import("./coordinate.js").Coordinate} [targetCenter] * @property {number} [sourceResolution] * @property {number} [targetResolution] * @property {number} [sourceRotation] * @property {number} [targetRotation] - * @property {module:ol/coordinate~Coordinate} [anchor] + * @property {import("./coordinate.js").Coordinate} [anchor] * @property {number} start * @property {number} duration * @property {boolean} complete @@ -45,15 +45,15 @@ import Units from './proj/Units.js'; /** * @typedef {Object} Constraints - * @property {module:ol/centerconstraint~Type} center - * @property {module:ol/resolutionconstraint~Type} resolution - * @property {module:ol/rotationconstraint~Type} rotation + * @property {import("./centerconstraint.js").Type} center + * @property {import("./resolutionconstraint.js").Type} resolution + * @property {import("./rotationconstraint.js").Type} rotation */ /** * @typedef {Object} FitOptions - * @property {module:ol/size~Size} [size] The size in pixels of the box to fit + * @property {import("./size.js").Size} [size] The size in pixels of the box to fit * the extent into. Default is the current size of the first map in the DOM that * uses this view, or `[100, 100]` if no such map is found. * @property {!Array} [padding=[0, 0, 0, 0]] Padding (in pixels) to be @@ -80,7 +80,7 @@ import Units from './proj/Units.js'; /** * @typedef {Object} ViewOptions - * @property {module:ol/coordinate~Coordinate} [center] The initial center for + * @property {import("./coordinate.js").Coordinate} [center] The initial center for * the view. The coordinate system for the center is specified with the * `projection` option. Layer sources will not be fetched if this is not set, * but the center can be set later with {@link #setCenter}. @@ -92,7 +92,7 @@ import Units from './proj/Units.js'; * If `false`, a rotation constraint that always sets the rotation to zero is * used. The `constrainRotation` option has no effect if `enableRotation` is * `false`. - * @property {module:ol/extent~Extent} [extent] The extent that constrains the + * @property {import("./extent.js").Extent} [extent] The extent that constrains the * center, in other words, center cannot be set outside this extent. * @property {number} [maxResolution] The maximum resolution used to determine * the resolution constraint. It is used together with `minResolution` (or @@ -114,7 +114,7 @@ import Units from './proj/Units.js'; * resolution constraint. It is used together with `maxZoom` (or * `minResolution`) and `zoomFactor`. Note that if `maxResolution` is also * provided, it is given precedence over `minZoom`. - * @property {module:ol/proj~ProjectionLike} [projection='EPSG:3857'] The + * @property {import("./proj.js").ProjectionLike} [projection='EPSG:3857'] The * projection. The default is Spherical Mercator. * @property {number} [resolution] The initial resolution for the view. The * units are `projection` units per pixel (e.g. meters per pixel). An @@ -136,7 +136,7 @@ import Units from './proj/Units.js'; /** * @typedef {Object} AnimationOptions - * @property {module:ol/coordinate~Coordinate|undefined} center The center of the view at the end of + * @property {import("./coordinate.js").Coordinate|undefined} center The center of the view at the end of * the animation. * @property {number|undefined} zoom The zoom level of the view at the end of the * animation. This takes precedence over `resolution`. @@ -144,7 +144,7 @@ import Units from './proj/Units.js'; * of the animation. If `zoom` is also provided, this option will be ignored. * @property {number|undefined} rotation The rotation of the view at the end of * the animation. - * @property {module:ol/coordinate~Coordinate|undefined} anchor Optional anchor to remained fixed + * @property {import("./coordinate.js").Coordinate|undefined} anchor Optional anchor to remained fixed * during a rotation or resolution animation. * @property {number} [duration=1000] The duration of the animation in milliseconds. * @property {function(number):number} [easing] The easing function used @@ -157,8 +157,8 @@ import Units from './proj/Units.js'; /** * @typedef {Object} State - * @property {module:ol/coordinate~Coordinate} center - * @property {module:ol/proj/Projection} projection + * @property {import("./coordinate.js").Coordinate} center + * @property {import("./proj/Projection.js").default} projection * @property {number} resolution * @property {number} rotation * @property {number} zoom @@ -229,7 +229,7 @@ const DEFAULT_MIN_ZOOM = 0; class View extends BaseObject { /** - * @param {module:ol/View~ViewOptions=} opt_options View options. + * @param {ViewOptions=} opt_options View options. */ constructor(opt_options) { super(); @@ -244,7 +244,7 @@ class View extends BaseObject { /** * @private - * @type {Array>} + * @type {Array>} */ this.animations_ = []; @@ -259,7 +259,7 @@ class View extends BaseObject { /** * @private * @const - * @type {module:ol/proj/Projection} + * @type {import("./proj/Projection.js").default} */ this.projection_ = createProjection(options.projection, 'EPSG:3857'); @@ -268,7 +268,7 @@ class View extends BaseObject { /** * Set up the view with the given options. - * @param {module:ol/View~ViewOptions} options View options. + * @param {ViewOptions} options View options. */ applyOptions_(options) { @@ -317,7 +317,7 @@ class View extends BaseObject { /** * @private - * @type {module:ol/View~Constraints} + * @type {Constraints} */ this.constraints_ = { center: centerConstraint, @@ -342,7 +342,7 @@ class View extends BaseObject { /** * @private - * @type {module:ol/View~ViewOptions} + * @type {ViewOptions} */ this.options_ = options; @@ -353,8 +353,8 @@ class View extends BaseObject { * current resolution (or zoom), center, and rotation are applied to any stored * options. The provided options can be used to apply new min/max zoom or * resolution limits. - * @param {module:ol/View~ViewOptions} newOptions New options to be applied. - * @return {module:ol/View~ViewOptions} New options updated with the current view state. + * @param {ViewOptions} newOptions New options to be applied. + * @return {ViewOptions} New options updated with the current view state. */ getUpdatedOptions_(newOptions) { const options = assign({}, this.options_); @@ -400,7 +400,7 @@ class View extends BaseObject { * calling `view.setCenter()`, `view.setResolution()`, or `view.setRotation()` * (or another method that calls one of these). * - * @param {...(module:ol/View~AnimationOptions|function(boolean))} var_args Animation + * @param {...(AnimationOptions|function(boolean))} var_args Animation * options. Multiple animations can be run in series by passing multiple * options objects. To run multiple animations in parallel, call the method * multiple times. An optional callback can be provided as a final @@ -438,9 +438,9 @@ class View extends BaseObject { let rotation = this.getRotation(); const series = []; for (let i = 0; i < animationCount; ++i) { - const options = /** @type {module:ol/View~AnimationOptions} */ (arguments[i]); + const options = /** @type {AnimationOptions} */ (arguments[i]); - const animation = /** @type {module:ol/View~Animation} */ ({ + const animation = /** @type {Animation} */ ({ start: start, complete: false, anchor: options.anchor, @@ -603,8 +603,8 @@ class View extends BaseObject { /** * @param {number} rotation Target rotation. - * @param {module:ol/coordinate~Coordinate} anchor Rotation anchor. - * @return {module:ol/coordinate~Coordinate|undefined} Center for rotation and anchor. + * @param {import("./coordinate.js").Coordinate} anchor Rotation anchor. + * @return {import("./coordinate.js").Coordinate|undefined} Center for rotation and anchor. */ calculateCenterRotate(rotation, anchor) { let center; @@ -619,8 +619,8 @@ class View extends BaseObject { /** * @param {number} resolution Target resolution. - * @param {module:ol/coordinate~Coordinate} anchor Zoom anchor. - * @return {module:ol/coordinate~Coordinate|undefined} Center for resolution and anchor. + * @param {import("./coordinate.js").Coordinate} anchor Zoom anchor. + * @return {import("./coordinate.js").Coordinate|undefined} Center for resolution and anchor. */ calculateCenterZoom(resolution, anchor) { let center; @@ -636,7 +636,7 @@ class View extends BaseObject { /** * @private - * @return {module:ol/size~Size} Viewport size or `[100, 100]` when no viewport is found. + * @return {import("./size.js").Size} Viewport size or `[100, 100]` when no viewport is found. */ getSizeFromViewport_() { const size = [100, 100]; @@ -652,8 +652,8 @@ class View extends BaseObject { /** * Get the constrained center of this view. - * @param {module:ol/coordinate~Coordinate|undefined} center Center. - * @return {module:ol/coordinate~Coordinate|undefined} Constrained center. + * @param {import("./coordinate.js").Coordinate|undefined} center Center. + * @return {import("./coordinate.js").Coordinate|undefined} Constrained center. * @api */ constrainCenter(center) { @@ -688,18 +688,18 @@ class View extends BaseObject { /** * Get the view center. - * @return {module:ol/coordinate~Coordinate|undefined} The center of the view. + * @return {import("./coordinate.js").Coordinate|undefined} The center of the view. * @observable * @api */ getCenter() { return ( - /** @type {module:ol/coordinate~Coordinate|undefined} */ (this.get(ViewProperty.CENTER)) + /** @type {import("./coordinate.js").Coordinate|undefined} */ (this.get(ViewProperty.CENTER)) ); } /** - * @return {module:ol/View~Constraints} Constraints. + * @return {Constraints} Constraints. */ getConstraints() { return this.constraints_; @@ -724,14 +724,14 @@ class View extends BaseObject { * The size is the pixel dimensions of the box into which the calculated extent * should fit. In most cases you want to get the extent of the entire map, * that is `map.getSize()`. - * @param {module:ol/size~Size=} opt_size Box pixel size. If not provided, the size of the + * @param {import("./size.js").Size=} opt_size Box pixel size. If not provided, the size of the * first map that uses this view will be used. - * @return {module:ol/extent~Extent} Extent. + * @return {import("./extent.js").Extent} Extent. * @api */ calculateExtent(opt_size) { const size = opt_size || this.getSizeFromViewport_(); - const center = /** @type {!module:ol/coordinate~Coordinate} */ (this.getCenter()); + const center = /** @type {!import("./coordinate.js").Coordinate} */ (this.getCenter()); assert(center, 1); // The view center is not defined const resolution = /** @type {!number} */ (this.getResolution()); assert(resolution !== undefined, 2); // The view resolution is not defined @@ -797,7 +797,7 @@ class View extends BaseObject { /** * Get the view projection. - * @return {module:ol/proj/Projection} The projection of the view. + * @return {import("./proj/Projection.js").default} The projection of the view. * @api */ getProjection() { @@ -826,8 +826,8 @@ class View extends BaseObject { /** * Get the resolution for a provided extent (in map units) and size (in pixels). - * @param {module:ol/extent~Extent} extent Extent. - * @param {module:ol/size~Size=} opt_size Box pixel size. + * @param {import("./extent.js").Extent} extent Extent. + * @param {import("./size.js").Size=} opt_size Box pixel size. * @return {number} The resolution at which the provided extent will render at * the given size. * @api @@ -895,16 +895,16 @@ class View extends BaseObject { /** * @param {number} pixelRatio Pixel ratio for center rounding. - * @return {module:ol/View~State} View state. + * @return {State} View state. */ getState(pixelRatio) { - const center = /** @type {module:ol/coordinate~Coordinate} */ (this.getCenter()); + const center = /** @type {import("./coordinate.js").Coordinate} */ (this.getCenter()); const projection = this.getProjection(); const resolution = /** @type {number} */ (this.getResolution()); const pixelResolution = resolution / pixelRatio; const rotation = this.getRotation(); return ( - /** @type {module:ol/View~State} */ ({ + /** @type {State} */ ({ center: [ Math.round(center[0] / pixelResolution) * pixelResolution, Math.round(center[1] / pixelResolution) * pixelResolution @@ -974,9 +974,9 @@ class View extends BaseObject { * The size is pixel dimensions of the box to fit the extent into. * In most cases you will want to use the map size, that is `map.getSize()`. * Takes care of the map angle. - * @param {module:ol/geom/SimpleGeometry|module:ol/extent~Extent} geometryOrExtent The geometry or + * @param {import("./geom/SimpleGeometry.js").default|import("./extent.js").Extent} geometryOrExtent The geometry or * extent to fit the view to. - * @param {module:ol/View~FitOptions=} opt_options Options. + * @param {FitOptions=} opt_options Options. * @api */ fit(geometryOrExtent, opt_options) { @@ -985,7 +985,7 @@ class View extends BaseObject { if (!size) { size = this.getSizeFromViewport_(); } - /** @type {module:ol/geom/SimpleGeometry} */ + /** @type {import("./geom/SimpleGeometry.js").default} */ let geometry; if (!(geometryOrExtent instanceof SimpleGeometry)) { assert(Array.isArray(geometryOrExtent), @@ -1076,9 +1076,9 @@ class View extends BaseObject { /** * Center on coordinate and view position. - * @param {module:ol/coordinate~Coordinate} coordinate Coordinate. - * @param {module:ol/size~Size} size Box pixel size. - * @param {module:ol/pixel~Pixel} position Position on the view to center on. + * @param {import("./coordinate.js").Coordinate} coordinate Coordinate. + * @param {import("./size.js").Size} size Box pixel size. + * @param {import("./pixel.js").Pixel} position Position on the view to center on. * @api */ centerOn(coordinate, size, position) { @@ -1110,7 +1110,7 @@ class View extends BaseObject { /** * Rotate the view around a given coordinate. * @param {number} rotation New rotation value for the view. - * @param {module:ol/coordinate~Coordinate=} opt_anchor The rotation center. + * @param {import("./coordinate.js").Coordinate=} opt_anchor The rotation center. * @api */ rotate(rotation, opt_anchor) { @@ -1123,7 +1123,7 @@ class View extends BaseObject { /** * Set the center of the current view. - * @param {module:ol/coordinate~Coordinate|undefined} center The center of the view. + * @param {import("./coordinate.js").Coordinate|undefined} center The center of the view. * @observable * @api */ @@ -1135,7 +1135,7 @@ class View extends BaseObject { } /** - * @param {module:ol/ViewHint} hint Hint. + * @param {import("./ViewHint.js").default} hint Hint. * @param {number} delta Delta. * @return {number} New value. */ @@ -1194,8 +1194,8 @@ function animationCallback(callback, returnValue) { /** - * @param {module:ol/View~ViewOptions} options View options. - * @return {module:ol/centerconstraint~Type} The constraint. + * @param {ViewOptions} options View options. + * @return {import("./centerconstraint.js").Type} The constraint. */ export function createCenterConstraint(options) { if (options.extent !== undefined) { @@ -1207,8 +1207,8 @@ export function createCenterConstraint(options) { /** - * @param {module:ol/View~ViewOptions} options View options. - * @return {{constraint: module:ol/resolutionconstraint~Type, maxResolution: number, + * @param {ViewOptions} options View options. + * @return {{constraint: import("./resolutionconstraint.js").Type, maxResolution: number, * minResolution: number, minZoom: number, zoomFactor: number}} The constraint. */ export function createResolutionConstraint(options) { @@ -1289,8 +1289,8 @@ export function createResolutionConstraint(options) { /** - * @param {module:ol/View~ViewOptions} options View options. - * @return {module:ol/rotationconstraint~Type} Rotation constraint. + * @param {ViewOptions} options View options. + * @return {import("./rotationconstraint.js").Type} Rotation constraint. */ export function createRotationConstraint(options) { const enableRotation = options.enableRotation !== undefined ? @@ -1314,7 +1314,7 @@ export function createRotationConstraint(options) { /** * Determine if an animation involves no view change. - * @param {module:ol/View~Animation} animation The animation. + * @param {Animation} animation The animation. * @return {boolean} The animation involves no view change. */ export function isNoopAnimation(animation) { diff --git a/src/ol/WebGLMap.js b/src/ol/WebGLMap.js index cea3990b0c..5db5371194 100644 --- a/src/ol/WebGLMap.js +++ b/src/ol/WebGLMap.js @@ -56,8 +56,8 @@ import WebGLVectorLayerRenderer from './renderer/webgl/VectorLayer.js'; * {@link module:ol/layer/Base}, so layers entered in the options or added * with `addLayer` can be groups, which can contain further groups, and so on. * - * @fires module:ol/MapBrowserEvent~MapBrowserEvent - * @fires module:ol/MapEvent~MapEvent + * @fires import("./MapBrowserEvent.js").MapBrowserEvent + * @fires import("./MapEvent.js").MapEvent * @fires module:ol/render/Event~RenderEvent#postcompose * @fires module:ol/render/Event~RenderEvent#precompose * @api @@ -65,7 +65,7 @@ import WebGLVectorLayerRenderer from './renderer/webgl/VectorLayer.js'; class WebGLMap extends PluggableMap { /** - * @param {module:ol/PluggableMap~MapOptions} options Map options. + * @param {import("./PluggableMap.js").MapOptions} options Map options. */ constructor(options) { options = assign({}, options); diff --git a/src/ol/centerconstraint.js b/src/ol/centerconstraint.js index 03a51e530d..3d24463c8b 100644 --- a/src/ol/centerconstraint.js +++ b/src/ol/centerconstraint.js @@ -5,19 +5,19 @@ import {clamp} from './math.js'; /** - * @typedef {function((module:ol/coordinate~Coordinate|undefined)): (module:ol/coordinate~Coordinate|undefined)} Type + * @typedef {function((import("./coordinate.js").Coordinate|undefined)): (import("./coordinate.js").Coordinate|undefined)} Type */ /** - * @param {module:ol/extent~Extent} extent Extent. - * @return {module:ol/centerconstraint~Type} The constraint. + * @param {import("./extent.js").Extent} extent Extent. + * @return {Type} The constraint. */ export function createExtent(extent) { return ( /** - * @param {module:ol/coordinate~Coordinate=} center Center. - * @return {module:ol/coordinate~Coordinate|undefined} Center. + * @param {import("./coordinate.js").Coordinate=} center Center. + * @return {import("./coordinate.js").Coordinate|undefined} Center. */ function(center) { if (center) { @@ -34,8 +34,8 @@ export function createExtent(extent) { /** - * @param {module:ol/coordinate~Coordinate=} center Center. - * @return {module:ol/coordinate~Coordinate|undefined} Center. + * @param {import("./coordinate.js").Coordinate=} center Center. + * @return {import("./coordinate.js").Coordinate|undefined} Center. */ export function none(center) { return center; diff --git a/src/ol/color.js b/src/ol/color.js index 0ad5e3ad56..16572846b3 100644 --- a/src/ol/color.js +++ b/src/ol/color.js @@ -35,7 +35,7 @@ const NAMED_COLOR_RE_ = /^([a-z]*)$/i; /** * Return the color as an rgba string. - * @param {module:ol/color~Color|string} color Color. + * @param {Color|string} color Color. * @return {string} Rgba string. * @api */ @@ -68,7 +68,7 @@ function fromNamed(color) { /** * @param {string} s String. - * @return {module:ol/color~Color} Color. + * @return {Color} Color. */ export const fromString = ( function() { @@ -84,7 +84,7 @@ export const fromString = ( const MAX_CACHE_SIZE = 1024; /** - * @type {Object} + * @type {Object} */ const cache = {}; @@ -96,7 +96,7 @@ export const fromString = ( return ( /** * @param {string} s String. - * @return {module:ol/color~Color} Color. + * @return {Color} Color. */ function(s) { let color; @@ -125,8 +125,8 @@ export const fromString = ( /** * Return the color as an array. This function maintains a cache of calculated * arrays which means the result should not be modified. - * @param {module:ol/color~Color|string} color Color. - * @return {module:ol/color~Color} Color. + * @param {Color|string} color Color. + * @return {Color} Color. * @api */ export function asArray(color) { @@ -140,7 +140,7 @@ export function asArray(color) { /** * @param {string} s String. * @private - * @return {module:ol/color~Color} Color. + * @return {Color} Color. */ function fromStringInternal_(s) { let r, g, b, a, color; @@ -186,15 +186,15 @@ function fromStringInternal_(s) { assert(false, 14); // Invalid color } return ( - /** @type {module:ol/color~Color} */ (color) + /** @type {Color} */ (color) ); } /** * TODO this function is only used in the test, we probably shouldn't export it - * @param {module:ol/color~Color} color Color. - * @return {module:ol/color~Color} Clamped color. + * @param {Color} color Color. + * @return {Color} Clamped color. */ export function normalize(color) { color[0] = clamp((color[0] + 0.5) | 0, 0, 255); @@ -206,7 +206,7 @@ export function normalize(color) { /** - * @param {module:ol/color~Color} color Color. + * @param {Color} color Color. * @return {string} String. */ export function toString(color) { diff --git a/src/ol/colorlike.js b/src/ol/colorlike.js index 9e0c26b99b..ead3b2ccda 100644 --- a/src/ol/colorlike.js +++ b/src/ol/colorlike.js @@ -18,15 +18,15 @@ import {toString} from './color.js'; /** - * @param {module:ol/color~Color|module:ol/colorlike~ColorLike} color Color. - * @return {module:ol/colorlike~ColorLike} The color as an {@link ol/colorlike~ColorLike}. + * @param {import("./color.js").Color|ColorLike} color Color. + * @return {ColorLike} The color as an {@link ol/colorlike~ColorLike}. * @api */ export function asColorLike(color) { if (isColorLike(color)) { return /** @type {string|CanvasPattern|CanvasGradient} */ (color); } else { - return toString(/** @type {module:ol/color~Color} */ (color)); + return toString(/** @type {import("./color.js").Color} */ (color)); } } diff --git a/src/ol/control/Attribution.js b/src/ol/control/Attribution.js index 00546e91bc..5a3d1fcbc9 100644 --- a/src/ol/control/Attribution.js +++ b/src/ol/control/Attribution.js @@ -28,7 +28,7 @@ import {visibleAtResolution} from '../layer/Layer.js'; * @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 + * @property {function(import("../MapEvent.js").default)} [render] Function called when * the control should be re-rendered. This is called in a `requestAnimationFrame` * callback. */ @@ -46,7 +46,7 @@ import {visibleAtResolution} from '../layer/Layer.js'; class Attribution extends Control { /** - * @param {module:ol/control/Attribution~Options=} opt_options Attribution options. + * @param {Options=} opt_options Attribution options. */ constructor(opt_options) { @@ -146,7 +146,7 @@ class Attribution extends Control { /** * Get a list of visible attributions. - * @param {module:ol/PluggableMap~FrameState} frameState Frame state. + * @param {import("../PluggableMap.js").FrameState} frameState Frame state. * @return {Array} Attributions. * @private */ @@ -205,7 +205,7 @@ class Attribution extends Control { /** * @private - * @param {?module:ol/PluggableMap~FrameState} frameState Frame state. + * @param {?import("../PluggableMap.js").FrameState} frameState Frame state. */ updateElement_(frameState) { if (!frameState) { @@ -315,8 +315,8 @@ class Attribution extends Control { /** * Update the attribution element. - * @param {module:ol/MapEvent} mapEvent Map event. - * @this {module:ol/control/Attribution} + * @param {import("../MapEvent.js").default} mapEvent Map event. + * @this {import("./Attribution.js").default} * @api */ export function render(mapEvent) { diff --git a/src/ol/control/Control.js b/src/ol/control/Control.js index a0bc568cb5..5f838bf602 100644 --- a/src/ol/control/Control.js +++ b/src/ol/control/Control.js @@ -13,7 +13,7 @@ import {listen, unlistenByKey} from '../events.js'; * @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 + * @property {function(import("../MapEvent.js").default)} [render] Function called when * the control should be re-rendered. This is called in a `requestAnimationFrame` * callback. * @property {HTMLElement|string} [target] Specify a target if you want @@ -48,7 +48,7 @@ import {listen, unlistenByKey} from '../events.js'; class Control extends BaseObject { /** - * @param {module:ol/control/Control~Options} options Control options. + * @param {Options} options Control options. */ constructor(options) { @@ -68,18 +68,18 @@ class Control extends BaseObject { /** * @private - * @type {module:ol/PluggableMap} + * @type {import("../PluggableMap.js").default} */ this.map_ = null; /** * @protected - * @type {!Array} + * @type {!Array} */ this.listenerKeys = []; /** - * @type {function(module:ol/MapEvent)} + * @type {function(import("../MapEvent.js").default)} */ this.render = options.render ? options.render : VOID; @@ -99,7 +99,7 @@ class Control extends BaseObject { /** * Get the map associated with this control. - * @return {module:ol/PluggableMap} Map. + * @return {import("../PluggableMap.js").default} Map. * @api */ getMap() { @@ -110,7 +110,7 @@ class Control extends BaseObject { * 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. + * @param {import("../PluggableMap.js").default} map Map. * @api */ setMap(map) { diff --git a/src/ol/control/FullScreen.js b/src/ol/control/FullScreen.js index 9de77ff1c6..3111616066 100644 --- a/src/ol/control/FullScreen.js +++ b/src/ol/control/FullScreen.js @@ -65,7 +65,7 @@ const getChangeType = (function() { class FullScreen extends Control { /** - * @param {module:ol/control/FullScreen~Options=} opt_options Options. + * @param {Options=} opt_options Options. */ constructor(opt_options) { diff --git a/src/ol/control/MousePosition.js b/src/ol/control/MousePosition.js index 97684cb8e2..63b3fbe2dc 100644 --- a/src/ol/control/MousePosition.js +++ b/src/ol/control/MousePosition.js @@ -22,9 +22,9 @@ const COORDINATE_FORMAT = 'coordinateFormat'; /** * @typedef {Object} Options * @property {string} [className='ol-mouse-position'] CSS class name. - * @property {module:ol/coordinate~CoordinateFormat} [coordinateFormat] Coordinate format. - * @property {module:ol/proj~ProjectionLike} projection Projection. - * @property {function(module:ol/MapEvent)} [render] Function called when the + * @property {import("../coordinate.js").CoordinateFormat} [coordinateFormat] Coordinate format. + * @property {import("../proj.js").ProjectionLike} projection Projection. + * @property {function(import("../MapEvent.js").default)} [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 @@ -49,7 +49,7 @@ const COORDINATE_FORMAT = 'coordinateFormat'; class MousePosition extends Control { /** - * @param {module:ol/control/MousePosition~Options=} opt_options Mouse position options. + * @param {Options=} opt_options Mouse position options. */ constructor(opt_options) { @@ -95,19 +95,19 @@ class MousePosition extends Control { /** * @private - * @type {module:ol/proj/Projection} + * @type {import("../proj/Projection.js").default} */ this.mapProjection_ = null; /** * @private - * @type {?module:ol/proj~TransformFunction} + * @type {?import("../proj.js").TransformFunction} */ this.transform_ = null; /** * @private - * @type {module:ol/pixel~Pixel} + * @type {import("../pixel.js").Pixel} */ this.lastMouseMovePixel_ = null; @@ -123,27 +123,27 @@ class MousePosition extends Control { /** * Return the coordinate format type used to render the current position or * undefined. - * @return {module:ol/coordinate~CoordinateFormat|undefined} The format to render the current + * @return {import("../coordinate.js").CoordinateFormat|undefined} The format to render the current * position in. * @observable * @api */ getCoordinateFormat() { return ( - /** @type {module:ol/coordinate~CoordinateFormat|undefined} */ (this.get(COORDINATE_FORMAT)) + /** @type {import("../coordinate.js").CoordinateFormat|undefined} */ (this.get(COORDINATE_FORMAT)) ); } /** * Return the projection that is used to report the mouse position. - * @return {module:ol/proj/Projection|undefined} The projection to report mouse + * @return {import("../proj/Projection.js").default|undefined} The projection to report mouse * position in. * @observable * @api */ getProjection() { return ( - /** @type {module:ol/proj/Projection|undefined} */ (this.get(PROJECTION)) + /** @type {import("../proj/Projection.js").default|undefined} */ (this.get(PROJECTION)) ); } @@ -187,7 +187,7 @@ class MousePosition extends Control { /** * Set the coordinate format type used to render the current position. - * @param {module:ol/coordinate~CoordinateFormat} format The format to render the current + * @param {import("../coordinate.js").CoordinateFormat} format The format to render the current * position in. * @observable * @api @@ -198,7 +198,7 @@ class MousePosition extends Control { /** * Set the projection that is used to report the mouse position. - * @param {module:ol/proj~ProjectionLike} projection The projection to report mouse + * @param {import("../proj.js").ProjectionLike} projection The projection to report mouse * position in. * @observable * @api @@ -208,7 +208,7 @@ class MousePosition extends Control { } /** - * @param {?module:ol/pixel~Pixel} pixel Pixel. + * @param {?import("../pixel.js").Pixel} pixel Pixel. * @private */ updateHTML_(pixel) { @@ -245,8 +245,8 @@ class MousePosition extends Control { /** * Update the mouseposition element. - * @param {module:ol/MapEvent} mapEvent Map event. - * @this {module:ol/control/MousePosition} + * @param {import("../MapEvent.js").default} mapEvent Map event. + * @this {import("./MousePosition.js").default} * @api */ export function render(mapEvent) { diff --git a/src/ol/control/OverviewMap.js b/src/ol/control/OverviewMap.js index 33f411bf01..e09e0b27ae 100644 --- a/src/ol/control/OverviewMap.js +++ b/src/ol/control/OverviewMap.js @@ -44,15 +44,15 @@ const MIN_RATIO = 0.1; * @property {boolean} [collapsible=true] Whether the control can be collapsed or not. * @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] + * @property {Array|import("../Collection.js").default} [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 + * @property {function(import("../MapEvent.js").default)} [render] Function called when the control * should be re-rendered. This is called in a `requestAnimationFrame` callback. * @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, + * @property {import("../View.js").default} [view] Custom view for the overview map. If not provided, * a default view with an EPSG:3857 projection will be used. */ @@ -66,7 +66,7 @@ const MIN_RATIO = 0.1; class OverviewMap extends Control { /** - * @param {module:ol/control/OverviewMap~Options=} opt_options OverviewMap options. + * @param {Options=} opt_options OverviewMap options. */ constructor(opt_options) { @@ -144,7 +144,7 @@ class OverviewMap extends Control { this.ovmapDiv_.className = 'ol-overviewmap-map'; /** - * @type {module:ol/Map} + * @type {import("../Map.js").default} * @private */ this.ovmap_ = new Map({ @@ -157,7 +157,7 @@ class OverviewMap extends Control { if (options.layers) { options.layers.forEach( /** - * @param {module:ol/layer/Layer} layer Layer. + * @param {import("../layer/Layer.js").default} layer Layer. */ (function(layer) { ovmap.addLayer(layer); @@ -169,7 +169,7 @@ class OverviewMap extends Control { box.style.boxSizing = 'border-box'; /** - * @type {module:ol/Overlay} + * @type {import("../Overlay.js").default} * @private */ this.boxOverlay_ = new Overlay({ @@ -268,12 +268,12 @@ class OverviewMap extends Control { /** * Handle map property changes. This only deals with changes to the map's view. - * @param {module:ol/Object~ObjectEvent} event The propertychange event. + * @param {import("../Object.js").ObjectEvent} event The propertychange event. * @private */ handleMapPropertyChange_(event) { if (event.key === MapProperty.VIEW) { - const oldView = /** @type {module:ol/View} */ (event.oldValue); + const oldView = /** @type {import("../View.js").default} */ (event.oldValue); if (oldView) { this.unbindView_(oldView); } @@ -284,7 +284,7 @@ class OverviewMap extends Control { /** * Register listeners for view property changes. - * @param {module:ol/View} view The view. + * @param {import("../View.js").default} view The view. * @private */ bindView_(view) { @@ -295,7 +295,7 @@ class OverviewMap extends Control { /** * Unregister listeners for view property changes. - * @param {module:ol/View} view The view. + * @param {import("../View.js").default} view The view. * @private */ unbindView_(view) { @@ -333,12 +333,12 @@ class OverviewMap extends Control { return; } - const mapSize = /** @type {module:ol/size~Size} */ (map.getSize()); + const mapSize = /** @type {import("../size.js").Size} */ (map.getSize()); const view = map.getView(); const extent = view.calculateExtent(mapSize); - const ovmapSize = /** @type {module:ol/size~Size} */ (ovmap.getSize()); + const ovmapSize = /** @type {import("../size.js").Size} */ (ovmap.getSize()); const ovview = ovmap.getView(); const ovextent = ovview.calculateExtent(ovmapSize); @@ -377,7 +377,7 @@ class OverviewMap extends Control { const map = this.getMap(); const ovmap = this.ovmap_; - const mapSize = /** @type {module:ol/size~Size} */ (map.getSize()); + const mapSize = /** @type {import("../size.js").Size} */ (map.getSize()); const view = map.getView(); const extent = view.calculateExtent(mapSize); @@ -422,7 +422,7 @@ class OverviewMap extends Control { return; } - const mapSize = /** @type {module:ol/size~Size} */ (map.getSize()); + const mapSize = /** @type {import("../size.js").Size} */ (map.getSize()); const view = map.getView(); @@ -450,8 +450,8 @@ class OverviewMap extends Control { /** * @param {number} rotation Target rotation. - * @param {module:ol/coordinate~Coordinate} coordinate Coordinate. - * @return {module:ol/coordinate~Coordinate|undefined} Coordinate for rotation and center anchor. + * @param {import("../coordinate.js").Coordinate} coordinate Coordinate. + * @return {import("../coordinate.js").Coordinate|undefined} Coordinate for rotation and center anchor. * @private */ calculateCoordinateRotate_(rotation, coordinate) { @@ -558,7 +558,7 @@ class OverviewMap extends Control { /** * Return the overview map. - * @return {module:ol/PluggableMap} Overview map. + * @return {import("../PluggableMap.js").default} Overview map. * @api */ getOverviewMap() { @@ -569,8 +569,8 @@ class OverviewMap extends Control { /** * Update the overview map element. - * @param {module:ol/MapEvent} mapEvent Map event. - * @this {module:ol/control/OverviewMap} + * @param {import("../MapEvent.js").default} mapEvent Map event. + * @this {import("./OverviewMap.js").default} * @api */ export function render(mapEvent) { diff --git a/src/ol/control/Rotate.js b/src/ol/control/Rotate.js index cccff5dfa9..9eb72ef149 100644 --- a/src/ol/control/Rotate.js +++ b/src/ol/control/Rotate.js @@ -16,7 +16,7 @@ import EventType from '../events/EventType.js'; * @property {string} [tipLabel='Reset rotation'] Text label to use for the rotate tip. * @property {number} [duration=250] Animation duration in milliseconds. * @property {boolean} [autoHide=true] Hide the control when rotation is 0. - * @property {function(module:ol/MapEvent)} [render] Function called when the control should + * @property {function(import("../MapEvent.js").default)} [render] Function called when the control should * 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`. @@ -36,7 +36,7 @@ import EventType from '../events/EventType.js'; class Rotate extends Control { /** - * @param {module:ol/control/Rotate~Options=} opt_options Rotate options. + * @param {Options=} opt_options Rotate options. */ constructor(opt_options) { @@ -149,8 +149,8 @@ class Rotate extends Control { /** * Update the rotate control element. - * @param {module:ol/MapEvent} mapEvent Map event. - * @this {module:ol/control/Rotate} + * @param {import("../MapEvent.js").default} mapEvent Map event. + * @this {import("./Rotate.js").default} * @api */ export function render(mapEvent) { diff --git a/src/ol/control/ScaleLine.js b/src/ol/control/ScaleLine.js index db1417f7f1..d4ebdeb39f 100644 --- a/src/ol/control/ScaleLine.js +++ b/src/ol/control/ScaleLine.js @@ -40,11 +40,11 @@ const LEADING_DIGITS = [1, 2, 5]; * @typedef {Object} Options * @property {string} [className='ol-scale-line'] CSS Class name. * @property {number} [minWidth=64] Minimum width in pixels. - * @property {function(module:ol/MapEvent)} [render] Function called when the control + * @property {function(import("../MapEvent.js").default)} [render] Function called when the control * should be re-rendered. This is called in a `requestAnimationFrame` callback. * @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. + * @property {Units|string} [units='metric'] Units. */ @@ -63,7 +63,7 @@ const LEADING_DIGITS = [1, 2, 5]; class ScaleLine extends Control { /** - * @param {module:ol/control/ScaleLine~Options=} opt_options Scale line options. + * @param {Options=} opt_options Scale line options. */ constructor(opt_options) { @@ -89,7 +89,7 @@ class ScaleLine extends Control { /** * @private - * @type {?module:ol/View~State} + * @type {?import("../View.js").State} */ this.viewState_ = null; @@ -121,21 +121,21 @@ class ScaleLine extends Control { this, getChangeEventType(UNITS_PROP), this.handleUnitsChanged_, this); - this.setUnits(/** @type {module:ol/control/ScaleLine~Units} */ (options.units) || + this.setUnits(/** @type {Units} */ (options.units) || Units.METRIC); } /** * Return the units to use in the scale line. - * @return {module:ol/control/ScaleLine~Units|undefined} The units + * @return {Units|undefined} The units * to use in the scale line. * @observable * @api */ getUnits() { return ( - /** @type {module:ol/control/ScaleLine~Units|undefined} */ (this.get(UNITS_PROP)) + /** @type {Units|undefined} */ (this.get(UNITS_PROP)) ); } @@ -148,7 +148,7 @@ class ScaleLine extends Control { /** * Set the units to use in the scale line. - * @param {module:ol/control/ScaleLine~Units} units The units to use in the scale line. + * @param {Units} units The units to use in the scale line. * @observable * @api */ @@ -282,8 +282,8 @@ class ScaleLine extends Control { /** * Update the scale line element. - * @param {module:ol/MapEvent} mapEvent Map event. - * @this {module:ol/control/ScaleLine} + * @param {import("../MapEvent.js").default} mapEvent Map event. + * @this {import("./ScaleLine.js").default} * @api */ export function render(mapEvent) { diff --git a/src/ol/control/Zoom.js b/src/ol/control/Zoom.js index 011e1959fb..311730bd74 100644 --- a/src/ol/control/Zoom.js +++ b/src/ol/control/Zoom.js @@ -35,7 +35,7 @@ import {easeOut} from '../easing.js'; class Zoom extends Control { /** - * @param {module:ol/control/Zoom~Options=} opt_options Zoom options. + * @param {Options=} opt_options Zoom options. */ constructor(opt_options) { diff --git a/src/ol/control/ZoomSlider.js b/src/ol/control/ZoomSlider.js index 3ad70d7724..d99ce2781e 100644 --- a/src/ol/control/ZoomSlider.js +++ b/src/ol/control/ZoomSlider.js @@ -28,7 +28,7 @@ const Direction = { * @typedef {Object} Options * @property {string} [className='ol-zoomslider'] CSS class name. * @property {number} [duration=200] Animation duration in milliseconds. - * @property {function(module:ol/MapEvent)} [render] Function called when the control + * @property {function(import("../MapEvent.js").default)} [render] Function called when the control * should be re-rendered. This is called in a `requestAnimationFrame` callback. */ @@ -46,7 +46,7 @@ const Direction = { class ZoomSlider extends Control { /** - * @param {module:ol/control/ZoomSlider~Options=} opt_options Zoom slider options. + * @param {Options=} opt_options Zoom slider options. */ constructor(opt_options) { @@ -107,7 +107,7 @@ class ZoomSlider extends Control { /** * The calculated thumb size (border box plus margins). Set when initSlider_ * is called. - * @type {module:ol/size~Size} + * @type {import("../size.js").Size} * @private */ this.thumbSize_ = null; @@ -133,7 +133,7 @@ class ZoomSlider extends Control { containerElement.className = className + ' ' + CLASS_UNSELECTABLE + ' ' + CLASS_CONTROL; containerElement.appendChild(thumbElement); /** - * @type {module:ol/pointer/PointerEventHandler} + * @type {import("../pointer/PointerEventHandler.js").default} * @private */ this.dragger_ = new PointerEventHandler(containerElement); @@ -222,7 +222,7 @@ class ZoomSlider extends Control { /** * Handle dragger start events. - * @param {module:ol/pointer/PointerEvent} event The drag event. + * @param {import("../pointer/PointerEvent.js").default} event The drag event. * @private */ handleDraggerStart_(event) { @@ -237,7 +237,7 @@ class ZoomSlider extends Control { /** * Handle dragger drag events. * - * @param {module:ol/pointer/PointerEvent|Event} event The drag event. + * @param {import("../pointer/PointerEvent.js").default|Event} event The drag event. * @private */ handleDraggerDrag_(event) { @@ -256,7 +256,7 @@ class ZoomSlider extends Control { /** * Handle dragger end events. - * @param {module:ol/pointer/PointerEvent|Event} event The drag event. + * @param {import("../pointer/PointerEvent.js").default|Event} event The drag event. * @private */ handleDraggerEnd_(event) { @@ -344,8 +344,8 @@ class ZoomSlider extends Control { /** * Update the zoomslider element. - * @param {module:ol/MapEvent} mapEvent Map event. - * @this {module:ol/control/ZoomSlider} + * @param {import("../MapEvent.js").default} mapEvent Map event. + * @this {import("./ZoomSlider.js").default} * @api */ export function render(mapEvent) { diff --git a/src/ol/control/ZoomToExtent.js b/src/ol/control/ZoomToExtent.js index 113f7682ee..da287372e5 100644 --- a/src/ol/control/ZoomToExtent.js +++ b/src/ol/control/ZoomToExtent.js @@ -15,7 +15,7 @@ import {CLASS_CONTROL, CLASS_UNSELECTABLE} from '../css.js'; * @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 + * @property {import("../extent.js").Extent} [extent] The extent to zoom to. If undefined the validity * extent of the view projection is used. */ @@ -30,7 +30,7 @@ import {CLASS_CONTROL, CLASS_UNSELECTABLE} from '../css.js'; class ZoomToExtent extends Control { /** - * @param {module:ol/control/ZoomToExtent~Options=} opt_options Options. + * @param {Options=} opt_options Options. */ constructor(opt_options) { const options = opt_options ? opt_options : {}; @@ -41,7 +41,7 @@ class ZoomToExtent extends Control { }); /** - * @type {module:ol/extent~Extent} + * @type {import("../extent.js").Extent} * @protected */ this.extent = options.extent ? options.extent : null; diff --git a/src/ol/control/util.js b/src/ol/control/util.js index 6ca0477751..978b94fb9b 100644 --- a/src/ol/control/util.js +++ b/src/ol/control/util.js @@ -11,14 +11,14 @@ import Zoom from './Zoom.js'; * @typedef {Object} DefaultsOptions * @property {boolean} [attribution=true] Include * {@link module:ol/control/Attribution~Attribution}. - * @property {module:ol/control/Attribution~Options} [attributionOptions] + * @property {import("./Attribution.js").Options} [attributionOptions] * Options for {@link module:ol/control/Attribution~Attribution}. * @property {boolean} [rotate=true] Include * {@link module:ol/control/Rotate~Rotate}. - * @property {module:ol/control/Rotate~Options} [rotateOptions] Options + * @property {import("./Rotate.js").Options} [rotateOptions] Options * for {@link module:ol/control/Rotate~Rotate}. * @property {boolean} [zoom] Include {@link module:ol/control/Zoom~Zoom}. - * @property {module:ol/control/Zoom~Options} [zoomOptions] Options for + * @property {import("./Zoom.js").Options} [zoomOptions] Options for * {@link module:ol/control/Zoom~Zoom}. * @api */ @@ -32,9 +32,9 @@ import Zoom from './Zoom.js'; * * {@link module:ol/control/Rotate~Rotate} * * {@link module:ol/control/Attribution~Attribution} * - * @param {module:ol/control/util~DefaultsOptions=} opt_options + * @param {DefaultsOptions=} opt_options * Defaults options. - * @return {module:ol/Collection} + * @return {import("../Collection.js").default} * Controls. * @function module:ol/control.defaults * @api diff --git a/src/ol/coordinate.js b/src/ol/coordinate.js index cc8353cc13..d4aba09811 100644 --- a/src/ol/coordinate.js +++ b/src/ol/coordinate.js @@ -16,7 +16,7 @@ import {padNumber} from './string.js'; * A function that takes a {@link module:ol/coordinate~Coordinate} and * transforms it into a `{string}`. * - * @typedef {function((module:ol/coordinate~Coordinate|undefined)): string} CoordinateFormat + * @typedef {function((Coordinate|undefined)): string} CoordinateFormat * @api */ @@ -33,9 +33,9 @@ import {padNumber} from './string.js'; * add(coord, [-2, 4]); * // coord is now [5.85, 51.983333] * - * @param {module:ol/coordinate~Coordinate} coordinate Coordinate. - * @param {module:ol/coordinate~Coordinate} delta Delta. - * @return {module:ol/coordinate~Coordinate} The input coordinate adjusted by + * @param {Coordinate} coordinate Coordinate. + * @param {Coordinate} delta Delta. + * @return {Coordinate} The input coordinate adjusted by * the given delta. * @api */ @@ -49,9 +49,9 @@ export function add(coordinate, delta) { /** * Calculates the point closest to the passed coordinate on the passed circle. * - * @param {module:ol/coordinate~Coordinate} coordinate The coordinate. - * @param {module:ol/geom/Circle} circle The circle. - * @return {module:ol/coordinate~Coordinate} Closest point on the circumference. + * @param {Coordinate} coordinate The coordinate. + * @param {import("./geom/Circle.js").default} circle The circle. + * @return {Coordinate} Closest point on the circumference. */ export function closestOnCircle(coordinate, circle) { const r = circle.getRadius(); @@ -81,10 +81,10 @@ export function closestOnCircle(coordinate, circle) { * the foot is on the segment, or the closest segment coordinate when the foot * is outside the segment. * - * @param {module:ol/coordinate~Coordinate} coordinate The coordinate. - * @param {Array} segment The two coordinates + * @param {Coordinate} coordinate The coordinate. + * @param {Array} segment The two coordinates * of the segment. - * @return {module:ol/coordinate~Coordinate} The foot of the perpendicular of + * @return {Coordinate} The foot of the perpendicular of * the coordinate to the segment. */ export function closestOnSegment(coordinate, segment) { @@ -118,7 +118,7 @@ export function closestOnSegment(coordinate, segment) { /** * Returns a {@link module:ol/coordinate~CoordinateFormat} function that can be * used to format - * a {module:ol/coordinate~Coordinate} to a string. + * a {Coordinate} to a string. * * Example without specifying the fractional digits: * @@ -140,13 +140,13 @@ export function closestOnSegment(coordinate, segment) { * * @param {number=} opt_fractionDigits The number of digits to include * after the decimal point. Default is `0`. - * @return {module:ol/coordinate~CoordinateFormat} Coordinate format. + * @return {CoordinateFormat} Coordinate format. * @api */ export function createStringXY(opt_fractionDigits) { return ( /** - * @param {module:ol/coordinate~Coordinate} coordinate Coordinate. + * @param {Coordinate} coordinate Coordinate. * @return {string} String XY. */ function(coordinate) { @@ -213,7 +213,7 @@ export function degreesToStringHDMS(hemispheres, degrees, opt_fractionDigits) { * var out = format(coord, template, 2); * // out is now 'Coordinate is (7.85|47.98).' * - * @param {module:ol/coordinate~Coordinate} coordinate Coordinate. + * @param {Coordinate} coordinate Coordinate. * @param {string} template A template string with `{x}` and `{y}` placeholders * that will be replaced by first and second coordinate values. * @param {number=} opt_fractionDigits The number of digits to include @@ -233,8 +233,8 @@ export function format(coordinate, template, opt_fractionDigits) { /** - * @param {module:ol/coordinate~Coordinate} coordinate1 First coordinate. - * @param {module:ol/coordinate~Coordinate} coordinate2 Second coordinate. + * @param {Coordinate} coordinate1 First coordinate. + * @param {Coordinate} coordinate2 Second coordinate. * @return {boolean} The two coordinates are equal. */ export function equals(coordinate1, coordinate2) { @@ -262,9 +262,9 @@ export function equals(coordinate1, coordinate2) { * rotate(coord, rotateRadians); * // coord is now [-47.983333, 7.85] * - * @param {module:ol/coordinate~Coordinate} coordinate Coordinate. + * @param {Coordinate} coordinate Coordinate. * @param {number} angle Angle in radian. - * @return {module:ol/coordinate~Coordinate} Coordinate. + * @return {Coordinate} Coordinate. * @api */ export function rotate(coordinate, angle) { @@ -291,9 +291,9 @@ export function rotate(coordinate, angle) { * scaleCoordinate(coord, scale); * // coord is now [9.42, 57.5799996] * - * @param {module:ol/coordinate~Coordinate} coordinate Coordinate. + * @param {Coordinate} coordinate Coordinate. * @param {number} scale Scale factor. - * @return {module:ol/coordinate~Coordinate} Coordinate. + * @return {Coordinate} Coordinate. */ export function scale(coordinate, scale) { coordinate[0] *= scale; @@ -303,8 +303,8 @@ export function scale(coordinate, scale) { /** - * @param {module:ol/coordinate~Coordinate} coord1 First coordinate. - * @param {module:ol/coordinate~Coordinate} coord2 Second coordinate. + * @param {Coordinate} coord1 First coordinate. + * @param {Coordinate} coord2 Second coordinate. * @return {number} Squared distance between coord1 and coord2. */ export function squaredDistance(coord1, coord2) { @@ -315,8 +315,8 @@ export function squaredDistance(coord1, coord2) { /** - * @param {module:ol/coordinate~Coordinate} coord1 First coordinate. - * @param {module:ol/coordinate~Coordinate} coord2 Second coordinate. + * @param {Coordinate} coord1 First coordinate. + * @param {Coordinate} coord2 Second coordinate. * @return {number} Distance between coord1 and coord2. */ export function distance(coord1, coord2) { @@ -327,8 +327,8 @@ export function distance(coord1, coord2) { /** * Calculate the squared distance from a coordinate to a line segment. * - * @param {module:ol/coordinate~Coordinate} coordinate Coordinate of the point. - * @param {Array} segment Line segment (2 + * @param {Coordinate} coordinate Coordinate of the point. + * @param {Array} segment Line segment (2 * coordinates). * @return {number} Squared distance from the point to the line segment. */ @@ -358,7 +358,7 @@ export function squaredDistanceToSegment(coordinate, segment) { * var out = toStringHDMS(coord, 1); * // out is now '47° 58′ 60.0″ N 7° 50′ 60.0″ E' * - * @param {module:ol/coordinate~Coordinate} coordinate Coordinate. + * @param {Coordinate} coordinate Coordinate. * @param {number=} opt_fractionDigits The number of digits to include * after the decimal point. Default is `0`. * @return {string} Hemisphere, degrees, minutes and seconds. @@ -393,7 +393,7 @@ export function toStringHDMS(coordinate, opt_fractionDigits) { * var out = toStringXY(coord, 1); * // out is now '7.8, 48.0' * - * @param {module:ol/coordinate~Coordinate} coordinate Coordinate. + * @param {Coordinate} coordinate Coordinate. * @param {number=} opt_fractionDigits The number of digits to include * after the decimal point. Default is `0`. * @return {string} XY. diff --git a/src/ol/events.js b/src/ol/events.js index dde94cd3bf..52b1b75e10 100644 --- a/src/ol/events.js +++ b/src/ol/events.js @@ -8,11 +8,11 @@ import {clear} from './obj.js'; * Key to use with {@link module:ol/Observable~Observable#unByKey}. * @typedef {Object} EventsKey * @property {Object} [bindTo] - * @property {module:ol/events~ListenerFunction} [boundListener] + * @property {ListenerFunction} [boundListener] * @property {boolean} callOnce * @property {number} [deleteIndex] - * @property {module:ol/events~ListenerFunction} listener - * @property {module:ol/events/Target~EventTargetLike} target + * @property {ListenerFunction} listener + * @property {import("./events/Target.js").EventTargetLike} target * @property {string} type * @api */ @@ -22,14 +22,14 @@ import {clear} from './obj.js'; * Listener function. This function is called with an event object as argument. * When the function returns `false`, event propagation will stop. * - * @typedef {function(module:ol/events/Event)|function(module:ol/events/Event): boolean} ListenerFunction + * @typedef {function(import("./events/Event.js").default)|function(import("./events/Event.js").default): boolean} ListenerFunction * @api */ /** - * @param {module:ol/events~EventsKey} listenerObj Listener object. - * @return {module:ol/events~ListenerFunction} Bound listener. + * @param {EventsKey} listenerObj Listener object. + * @return {ListenerFunction} Bound listener. */ export function bindListener(listenerObj) { const boundListener = function(evt) { @@ -49,12 +49,12 @@ export function bindListener(listenerObj) { * Finds the matching {@link module:ol/events~EventsKey} in the given listener * array. * - * @param {!Array} listeners Array of listeners. + * @param {!Array} listeners Array of listeners. * @param {!Function} listener The listener function. * @param {Object=} opt_this The `this` value inside the listener. * @param {boolean=} opt_setDeleteIndex Set the deleteIndex on the matching * listener, for {@link module:ol/events~unlistenByKey}. - * @return {module:ol/events~EventsKey|undefined} The matching listener object. + * @return {EventsKey|undefined} The matching listener object. */ export function findListener(listeners, listener, opt_this, opt_setDeleteIndex) { let listenerObj; @@ -73,9 +73,9 @@ export function findListener(listeners, listener, opt_this, opt_setDeleteIndex) /** - * @param {module:ol/events/Target~EventTargetLike} target Target. + * @param {import("./events/Target.js").EventTargetLike} target Target. * @param {string} type Type. - * @return {Array|undefined} Listeners. + * @return {Array|undefined} Listeners. */ export function getListeners(target, type) { const listenerMap = target.ol_lm; @@ -86,8 +86,8 @@ export function getListeners(target, type) { /** * Get the lookup of listeners. If one does not exist on the target, it is * created. - * @param {module:ol/events/Target~EventTargetLike} target Target. - * @return {!Object>} Map of + * @param {import("./events/Target.js").EventTargetLike} target Target. + * @return {!Object>} Map of * listeners by event type. */ function getListenerMap(target) { @@ -103,7 +103,7 @@ function getListenerMap(target) { * Clean up all listener objects of the given type. All properties on the * listener objects will be removed, and if no listeners remain in the listener * map, it will be removed from the target. - * @param {module:ol/events/Target~EventTargetLike} target Target. + * @param {import("./events/Target.js").EventTargetLike} target Target. * @param {string} type Type. */ function removeListeners(target, type) { @@ -132,13 +132,13 @@ function removeListeners(target, type) { * This function efficiently binds a `listener` to a `this` object, and returns * a key for use with {@link module:ol/events~unlistenByKey}. * - * @param {module:ol/events/Target~EventTargetLike} target Event target. + * @param {import("./events/Target.js").EventTargetLike} target Event target. * @param {string} type Event type. - * @param {module:ol/events~ListenerFunction} listener Listener. + * @param {ListenerFunction} listener Listener. * @param {Object=} opt_this Object referenced by the `this` keyword in the * listener. Default is the `target`. * @param {boolean=} opt_once If true, add the listener as one-off listener. - * @return {module:ol/events~EventsKey} Unique key for the listener. + * @return {EventsKey} Unique key for the listener. */ export function listen(target, type, listener, opt_this, opt_once) { const listenerMap = getListenerMap(target); @@ -153,7 +153,7 @@ export function listen(target, type, listener, opt_this, opt_once) { listenerObj.callOnce = false; } } else { - listenerObj = /** @type {module:ol/events~EventsKey} */ ({ + listenerObj = /** @type {EventsKey} */ ({ bindTo: opt_this, callOnce: !!opt_once, listener: listener, @@ -181,12 +181,12 @@ export function listen(target, type, listener, opt_this, opt_once) { * function, the self-unregistering listener will be turned into a permanent * listener. * - * @param {module:ol/events/Target~EventTargetLike} target Event target. + * @param {import("./events/Target.js").EventTargetLike} target Event target. * @param {string} type Event type. - * @param {module:ol/events~ListenerFunction} listener Listener. + * @param {ListenerFunction} listener Listener. * @param {Object=} opt_this Object referenced by the `this` keyword in the * listener. Default is the `target`. - * @return {module:ol/events~EventsKey} Key for unlistenByKey. + * @return {EventsKey} Key for unlistenByKey. */ export function listenOnce(target, type, listener, opt_this) { return listen(target, type, listener, opt_this, true); @@ -200,9 +200,9 @@ export function listenOnce(target, type, listener, opt_this) { * To return a listener, this function needs to be called with the exact same * arguments that were used for a previous {@link module:ol/events~listen} call. * - * @param {module:ol/events/Target~EventTargetLike} target Event target. + * @param {import("./events/Target.js").EventTargetLike} target Event target. * @param {string} type Event type. - * @param {module:ol/events~ListenerFunction} listener Listener. + * @param {ListenerFunction} listener Listener. * @param {Object=} opt_this Object referenced by the `this` keyword in the * listener. Default is the `target`. */ @@ -224,7 +224,7 @@ export function unlisten(target, type, listener, opt_this) { * The argument passed to this function is the key returned from * {@link module:ol/events~listen} or {@link module:ol/events~listenOnce}. * - * @param {module:ol/events~EventsKey} key The key. + * @param {EventsKey} key The key. */ export function unlistenByKey(key) { if (key && key.target) { @@ -248,7 +248,7 @@ export function unlistenByKey(key) { * Unregisters all event listeners on an event target. Inspired by * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html * - * @param {module:ol/events/Target~EventTargetLike} target Target. + * @param {import("./events/Target.js").EventTargetLike} target Target. */ export function unlistenAll(target) { const listenerMap = getListenerMap(target); diff --git a/src/ol/events/Event.js b/src/ol/events/Event.js index fd43453b40..c4c494384e 100644 --- a/src/ol/events/Event.js +++ b/src/ol/events/Event.js @@ -61,7 +61,7 @@ class Event { /** - * @param {Event|module:ol/events/Event} evt Event + * @param {Event|import("./Event.js").default} evt Event */ export function stopPropagation(evt) { evt.stopPropagation(); @@ -69,7 +69,7 @@ export function stopPropagation(evt) { /** - * @param {Event|module:ol/events/Event} evt Event + * @param {Event|import("./Event.js").default} evt Event */ export function preventDefault(evt) { evt.preventDefault(); diff --git a/src/ol/events/Target.js b/src/ol/events/Target.js index 0639b94abf..cb51b211ec 100644 --- a/src/ol/events/Target.js +++ b/src/ol/events/Target.js @@ -8,7 +8,7 @@ import Event from '../events/Event.js'; /** - * @typedef {EventTarget|module:ol/events/Target} EventTargetLike + * @typedef {EventTarget|import("./Target.js").default} EventTargetLike */ @@ -46,7 +46,7 @@ class Target extends Disposable { /** * @private - * @type {!Object>} + * @type {!Object>} */ this.listeners_ = {}; @@ -54,7 +54,7 @@ class Target extends Disposable { /** * @param {string} type Type. - * @param {module:ol/events~ListenerFunction} listener Listener. + * @param {import("../events.js").ListenerFunction} listener Listener. */ addEventListener(type, listener) { let listeners = this.listeners_[type]; @@ -72,8 +72,8 @@ class Target extends Disposable { * Object with a `type` property. * * @param {{type: string, - * target: (module:ol/events/Target~EventTargetLike|undefined)}| - * module:ol/events/Event|string} event Event object. + * target: (EventTargetLike|undefined)}| + * import("./Event.js").default|string} event Event object. * @return {boolean|undefined} `false` if anyone called preventDefault on the * event object or if any of the listeners returned false. * @function @@ -122,7 +122,7 @@ class Target extends Disposable { * order that they will be called in. * * @param {string} type Type. - * @return {Array} Listeners. + * @return {Array} Listeners. */ getListeners(type) { return this.listeners_[type]; @@ -141,7 +141,7 @@ class Target extends Disposable { /** * @param {string} type Type. - * @param {module:ol/events~ListenerFunction} listener Listener. + * @param {import("../events.js").ListenerFunction} listener Listener. */ removeEventListener(type, listener) { const listeners = this.listeners_[type]; diff --git a/src/ol/events/condition.js b/src/ol/events/condition.js index a2cf454768..69f5f90a90 100644 --- a/src/ol/events/condition.js +++ b/src/ol/events/condition.js @@ -11,7 +11,7 @@ import {WEBKIT, MAC} from '../has.js'; * A function that takes an {@link module:ol/MapBrowserEvent} and returns a * `{boolean}`. If the condition is met, true should be returned. * - * @typedef {function(this: ?, module:ol/MapBrowserEvent): boolean} Condition + * @typedef {function(this: ?, import("../MapBrowserEvent.js").default): boolean} Condition */ @@ -19,7 +19,7 @@ import {WEBKIT, MAC} from '../has.js'; * Return `true` if only the alt-key is pressed, `false` otherwise (e.g. when * additionally the shift-key is pressed). * - * @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event. + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. * @return {boolean} True if only the alt key is pressed. * @api */ @@ -36,7 +36,7 @@ export const altKeyOnly = function(mapBrowserEvent) { * Return `true` if only the alt-key and shift-key is pressed, `false` otherwise * (e.g. when additionally the platform-modifier-key is pressed). * - * @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event. + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. * @return {boolean} True if only the alt and shift keys are pressed. * @api */ @@ -53,7 +53,7 @@ export const altShiftKeysOnly = function(mapBrowserEvent) { * Return `true` if the map has the focus. This condition requires a map target * element with a `tabindex` attribute, e.g. `
`. * - * @param {module:ol/MapBrowserEvent} event Map browser event. + * @param {import("../MapBrowserEvent.js").default} event Map browser event. * @return {boolean} The map has the focus. * @api */ @@ -65,7 +65,7 @@ export const focus = function(event) { /** * Return always true. * - * @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event. + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. * @return {boolean} True. * @function * @api @@ -76,7 +76,7 @@ export const always = TRUE; /** * Return `true` if the event is a `click` event, `false` otherwise. * - * @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event. + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. * @return {boolean} True if the event is a map `click` event. * @api */ @@ -91,7 +91,7 @@ export const click = function(mapBrowserEvent) { * By definition, this includes left-click on windows/linux, and left-click * without the ctrl key on Macs. * - * @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event. + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. * @return {boolean} The result. */ export const mouseActionButton = function(mapBrowserEvent) { @@ -104,7 +104,7 @@ export const mouseActionButton = function(mapBrowserEvent) { /** * Return always false. * - * @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event. + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. * @return {boolean} False. * @function * @api @@ -116,7 +116,7 @@ export const never = FALSE; * Return `true` if the browser event is a `pointermove` event, `false` * otherwise. * - * @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event. + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. * @return {boolean} True if the browser event is a `pointermove` event. * @api */ @@ -128,7 +128,7 @@ export const pointerMove = function(mapBrowserEvent) { /** * Return `true` if the event is a map `singleclick` event, `false` otherwise. * - * @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event. + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. * @return {boolean} True if the event is a map `singleclick` event. * @api */ @@ -140,7 +140,7 @@ export const singleClick = function(mapBrowserEvent) { /** * Return `true` if the event is a map `dblclick` event, `false` otherwise. * - * @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event. + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. * @return {boolean} True if the event is a map `dblclick` event. * @api */ @@ -153,7 +153,7 @@ export const doubleClick = function(mapBrowserEvent) { * Return `true` if no modifier key (alt-, shift- or platform-modifier-key) is * pressed. * - * @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event. + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. * @return {boolean} True only if there no modifier keys are pressed. * @api */ @@ -171,7 +171,7 @@ export const noModifierKeys = function(mapBrowserEvent) { * ctrl-key otherwise) is pressed, `false` otherwise (e.g. when additionally * the shift-key is pressed). * - * @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event. + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. * @return {boolean} True if only the platform modifier key is pressed. * @api */ @@ -187,7 +187,7 @@ export const platformModifierKeyOnly = function(mapBrowserEvent) { * Return `true` if only the shift-key is pressed, `false` otherwise (e.g. when * additionally the alt-key is pressed). * - * @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event. + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. * @return {boolean} True if only the shift key is pressed. * @api */ @@ -204,7 +204,7 @@ export const shiftKeyOnly = function(mapBrowserEvent) { * Return `true` if the target element is not editable, i.e. not a ``-, * `