Use imports for enum types

This commit is contained in:
Andreas Hocevar
2020-04-05 08:54:32 +02:00
parent c8d5fc418c
commit b0f20d6bd6
33 changed files with 77 additions and 77 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ const Property = {
*/ */
export class CollectionEvent extends Event { export class CollectionEvent extends Event {
/** /**
* @param {CollectionEventType} type Type. * @param {import("./CollectionEventType.js").default} type Type.
* @param {*=} opt_element Element. * @param {*=} opt_element Element.
* @param {number=} opt_index The index of the added or removed element. * @param {number=} opt_index The index of the added or removed element.
*/ */
+1 -1
View File
@@ -68,7 +68,7 @@ class ImageWrapper extends ImageBase {
/** /**
* @protected * @protected
* @type {ImageState} * @type {import("./ImageState.js").default}
*/ */
this.state = ImageState.IDLE; this.state = ImageState.IDLE;
+1 -1
View File
@@ -9,7 +9,7 @@ import {listenImage} from './Image.js';
class ImageTile extends Tile { class ImageTile extends Tile {
/** /**
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate. * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
* @param {TileState} state State. * @param {import("./TileState.js").default} state State.
* @param {string} src Image source URI. * @param {string} src Image source URI.
* @param {?string} crossOrigin Cross origin. * @param {?string} crossOrigin Cross origin.
* @param {import("./Tile.js").LoadFunction} tileLoadFunction Tile load function. * @param {import("./Tile.js").LoadFunction} tileLoadFunction Tile load function.
+5 -5
View File
@@ -21,7 +21,7 @@ import {outerHeight, outerWidth, removeChildren, removeNode} from './dom.js';
* shifts the overlay down. * shifts the overlay down.
* @property {import("./coordinate.js").Coordinate} [position] The overlay position * @property {import("./coordinate.js").Coordinate} [position] The overlay position
* in map projection. * in map projection.
* @property {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. * the overlay is actually positioned with respect to its `position` property.
* Possible values are `'bottom-left'`, `'bottom-center'`, `'bottom-right'`, * Possible values are `'bottom-left'`, `'bottom-center'`, `'bottom-right'`,
* `'center-left'`, `'center-center'`, `'center-right'`, `'top-left'`, * `'center-left'`, `'center-center'`, `'center-right'`, `'top-left'`,
@@ -204,7 +204,7 @@ class Overlay extends BaseObject {
this.setPositioning( this.setPositioning(
options.positioning !== undefined options.positioning !== undefined
? /** @type {OverlayPositioning} */ (options.positioning) ? /** @type {import("./OverlayPositioning.js").default} */ (options.positioning)
: OverlayPositioning.TOP_LEFT : OverlayPositioning.TOP_LEFT
); );
@@ -270,13 +270,13 @@ class Overlay extends BaseObject {
/** /**
* Get the current positioning of this overlay. * Get the current positioning of this overlay.
* @return {OverlayPositioning} How the overlay is positioned * @return {import("./OverlayPositioning.js").default} How the overlay is positioned
* relative to its point on the map. * relative to its point on the map.
* @observable * @observable
* @api * @api
*/ */
getPositioning() { getPositioning() {
return /** @type {OverlayPositioning} */ (this.get(Property.POSITIONING)); return /** @type {import("./OverlayPositioning.js").default} */ (this.get(Property.POSITIONING));
} }
/** /**
@@ -481,7 +481,7 @@ class Overlay extends BaseObject {
/** /**
* Set the positioning for this overlay. * Set the positioning for this overlay.
* @param {OverlayPositioning} positioning how the overlay is * @param {import("./OverlayPositioning.js").default} positioning how the overlay is
* positioned relative to its point on the map. * positioned relative to its point on the map.
* @observable * @observable
* @api * @api
+4 -4
View File
@@ -75,7 +75,7 @@ import {easeIn} from './easing.js';
class Tile extends EventTarget { class Tile extends EventTarget {
/** /**
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate. * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
* @param {TileState} state State. * @param {import("./TileState.js").default} state State.
* @param {Options=} opt_options Tile options. * @param {Options=} opt_options Tile options.
*/ */
constructor(tileCoord, state, opt_options) { constructor(tileCoord, state, opt_options) {
@@ -90,7 +90,7 @@ class Tile extends EventTarget {
/** /**
* @protected * @protected
* @type {TileState} * @type {import("./TileState.js").default}
*/ */
this.state = state; this.state = state;
@@ -227,7 +227,7 @@ class Tile extends EventTarget {
} }
/** /**
* @return {TileState} State. * @return {import("./TileState.js").default} State.
*/ */
getState() { getState() {
return this.state; return this.state;
@@ -238,7 +238,7 @@ class Tile extends EventTarget {
* it is important to set the state correctly to {@link module:ol/TileState~ERROR} * 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 * when the tile cannot be loaded. Otherwise the tile cannot be removed from
* the tile queue and will block other requests. * the tile queue and will block other requests.
* @param {TileState} state State. * @param {import("./TileState.js").default} state State.
* @api * @api
*/ */
setState(state) { setState(state) {
+1 -1
View File
@@ -7,7 +7,7 @@ import TileState from './TileState.js';
class VectorTile extends Tile { class VectorTile extends Tile {
/** /**
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate. * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
* @param {TileState} state State. * @param {import("./TileState.js").default} state State.
* @param {string} src Data source url. * @param {string} src Data source url.
* @param {import("./format/Feature.js").default} format Feature format. * @param {import("./format/Feature.js").default} format Feature format.
* @param {import("./Tile.js").LoadFunction} tileLoadFunction Tile load function. * @param {import("./Tile.js").LoadFunction} tileLoadFunction Tile load function.
+1 -1
View File
@@ -1481,7 +1481,7 @@ class View extends BaseObject {
} }
/** /**
* @param {ViewHint} hint Hint. * @param {import("./ViewHint.js").default} hint Hint.
* @param {number} delta Delta. * @param {number} delta Delta.
* @return {number} New value. * @return {number} New value.
*/ */
+3 -3
View File
@@ -47,7 +47,7 @@ const DEFAULT_DPI = 25.4 / 0.28;
* should be re-rendered. This is called in a `requestAnimationFrame` callback. * should be re-rendered. This is called in a `requestAnimationFrame` callback.
* @property {HTMLElement|string} [target] Specify a target if you want the control * @property {HTMLElement|string} [target] Specify a target if you want the control
* to be rendered outside of the map's viewport. * to be rendered outside of the map's viewport.
* @property {Units|string} [units='metric'] Units. * @property {import("./ScaleLine.js").Units|string} [units='metric'] Units.
* @property {boolean} [bar=false] Render scalebars instead of a line. * @property {boolean} [bar=false] Render scalebars instead of a line.
* @property {number} [steps=4] Number of steps the scalebar should use. Use even numbers * @property {number} [steps=4] Number of steps the scalebar should use. Use even numbers
* for best results. Only applies when `bar` is `true`. * for best results. Only applies when `bar` is `true`.
@@ -165,7 +165,7 @@ class ScaleLine extends Control {
/** /**
* Return the units to use in the scale line. * Return the units to use in the scale line.
* @return {Units} The units * @return {import("./ScaleLine.js").Units} The units
* to use in the scale line. * to use in the scale line.
* @observable * @observable
* @api * @api
@@ -183,7 +183,7 @@ class ScaleLine extends Control {
/** /**
* Set the units to use in the scale line. * Set the units to use in the scale line.
* @param {Units} units The units to use in the scale line. * @param {import("./ScaleLine.js").Units} units The units to use in the scale line.
* @observable * @observable
* @api * @api
*/ */
+2 -2
View File
@@ -160,7 +160,7 @@ export function containsXY(extent, x, y) {
* Get the relationship between a coordinate and extent. * Get the relationship between a coordinate and extent.
* @param {Extent} extent The extent. * @param {Extent} extent The extent.
* @param {import("./coordinate.js").Coordinate} coordinate The coordinate. * @param {import("./coordinate.js").Coordinate} coordinate The coordinate.
* @return {Relationship} The relationship (bitwise compare with * @return {import("./extent/Relationship.js").default} The relationship (bitwise compare with
* import("./extent/Relationship.js").Relationship). * import("./extent/Relationship.js").Relationship).
*/ */
export function coordinateRelationship(extent, coordinate) { export function coordinateRelationship(extent, coordinate) {
@@ -484,7 +484,7 @@ export function getCenter(extent) {
/** /**
* Get a corner coordinate of an extent. * Get a corner coordinate of an extent.
* @param {Extent} extent Extent. * @param {Extent} extent Extent.
* @param {Corner} corner Corner. * @param {import("./extent/Corner.js").default} corner Corner.
* @return {import("./coordinate.js").Coordinate} Corner coordinate. * @return {import("./coordinate.js").Coordinate} Corner coordinate.
*/ */
export function getCorner(extent, corner) { export function getCorner(extent, corner) {
+1 -1
View File
@@ -558,7 +558,7 @@ function appendCoordinate(flatCoordinates, layoutOptions, node, values) {
* @param {LayoutOptions} layoutOptions Layout options. * @param {LayoutOptions} layoutOptions Layout options.
* @param {Array<number>} flatCoordinates Flat coordinates. * @param {Array<number>} flatCoordinates Flat coordinates.
* @param {Array<number>=} ends Ends. * @param {Array<number>=} ends Ends.
* @return {GeometryLayout} Layout. * @return {import("../geom/GeometryLayout.js").default} Layout.
*/ */
function applyLayoutOptions(layoutOptions, flatCoordinates, ends) { function applyLayoutOptions(layoutOptions, flatCoordinates, ends) {
let layout = GeometryLayout.XY; let layout = GeometryLayout.XY;
+6 -6
View File
@@ -57,10 +57,10 @@ import {transformGeometryWithOptions} from './Feature.js';
/** /**
* @typedef {Object} Vec2 * @typedef {Object} Vec2
* @property {number} x * @property {number} x
* @property {IconAnchorUnits} xunits * @property {import("../style/IconAnchorUnits").default} xunits
* @property {number} y * @property {number} y
* @property {IconAnchorUnits} yunits * @property {import("../style/IconAnchorUnits").default} yunits
* @property {IconOrigin} origin * @property {import("../style/IconOrigin.js").default} origin
*/ */
/** /**
@@ -96,7 +96,7 @@ const SCHEMA_LOCATION =
'https://developers.google.com/kml/schema/kml22gx.xsd'; 'https://developers.google.com/kml/schema/kml22gx.xsd';
/** /**
* @type {Object<string, IconAnchorUnits>} * @type {Object<string, import("../style/IconAnchorUnits").default>}
*/ */
const ICON_ANCHOR_UNITS_MAP = { const ICON_ANCHOR_UNITS_MAP = {
'fraction': IconAnchorUnits.FRACTION, 'fraction': IconAnchorUnits.FRACTION,
@@ -212,12 +212,12 @@ export function getDefaultFillStyle() {
let DEFAULT_IMAGE_STYLE_ANCHOR; let DEFAULT_IMAGE_STYLE_ANCHOR;
/** /**
* @type {IconAnchorUnits} * @type {import("../style/IconAnchorUnits").default}
*/ */
let DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS; let DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS;
/** /**
* @type {IconAnchorUnits} * @type {import("../style/IconAnchorUnits").default}
*/ */
let DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS; let DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS;
+2 -2
View File
@@ -421,10 +421,10 @@ function readRawFeature(pbf, layer, i) {
* @param {number} type The raw feature's geometry type * @param {number} type The raw feature's geometry type
* @param {number} numEnds Number of ends of the flat coordinates of the * @param {number} numEnds Number of ends of the flat coordinates of the
* geometry. * geometry.
* @return {GeometryType} The geometry type. * @return {import("../geom/GeometryType.js").default} The geometry type.
*/ */
function getGeometryType(type, numEnds) { function getGeometryType(type, numEnds) {
/** @type {GeometryType} */ /** @type {import("../geom/GeometryType.js").default} */
let geometryType; let geometryType;
if (type === 1) { if (type === 1) {
geometryType = geometryType =
+1 -1
View File
@@ -55,7 +55,7 @@ class Polyline extends TextFeature {
/** /**
* @private * @private
* @type {GeometryLayout} * @type {import("../geom/GeometryLayout").default}
*/ */
this.geometryLayout_ = options.geometryLayout this.geometryLayout_ = options.geometryLayout
? options.geometryLayout ? options.geometryLayout
+3 -3
View File
@@ -16,7 +16,7 @@ import {transformGeometryWithOptions} from './Feature.js';
/** /**
* Geometry constructors * Geometry constructors
* @enum {function (new:import("../geom/Geometry.js").default, Array, GeometryLayout)} * @enum {function (new:import("../geom/Geometry.js").default, Array, import("../geom/GeometryLayout.js").default)}
*/ */
const GeometryConstructor = { const GeometryConstructor = {
'POINT': Point, 'POINT': Point,
@@ -241,7 +241,7 @@ class Parser {
this.token_; this.token_;
/** /**
* @type {GeometryLayout} * @type {import("../geom/GeometryLayout.js").default}
* @private * @private
*/ */
this.layout_ = GeometryLayout.XY; this.layout_ = GeometryLayout.XY;
@@ -290,7 +290,7 @@ class Parser {
/** /**
* Try to parse the dimensional info. * Try to parse the dimensional info.
* @return {GeometryLayout} The layout. * @return {import("../geom/GeometryLayout.js").default} The layout.
* @private * @private
*/ */
parseGeometryLayout_() { parseGeometryLayout_() {
+2 -2
View File
@@ -25,7 +25,7 @@ class LineString extends SimpleGeometry {
/** /**
* @param {Array<import("../coordinate.js").Coordinate>|Array<number>} coordinates Coordinates. * @param {Array<import("../coordinate.js").Coordinate>|Array<number>} coordinates Coordinates.
* For internal use, flat coordinates in combination with `opt_layout` are also accepted. * For internal use, flat coordinates in combination with `opt_layout` are also accepted.
* @param {GeometryLayout=} opt_layout Layout. * @param {import("./GeometryLayout.js").default=} opt_layout Layout.
*/ */
constructor(coordinates, opt_layout) { constructor(coordinates, opt_layout) {
super(); super();
@@ -287,7 +287,7 @@ class LineString extends SimpleGeometry {
/** /**
* Set the coordinates of the linestring. * Set the coordinates of the linestring.
* @param {!Array<import("../coordinate.js").Coordinate>} coordinates Coordinates. * @param {!Array<import("../coordinate.js").Coordinate>} coordinates Coordinates.
* @param {GeometryLayout=} opt_layout Layout. * @param {import("./GeometryLayout.js").default=} opt_layout Layout.
* @api * @api
*/ */
setCoordinates(coordinates, opt_layout) { setCoordinates(coordinates, opt_layout) {
+2 -2
View File
@@ -22,7 +22,7 @@ class LinearRing extends SimpleGeometry {
/** /**
* @param {Array<import("../coordinate.js").Coordinate>|Array<number>} coordinates Coordinates. * @param {Array<import("../coordinate.js").Coordinate>|Array<number>} coordinates Coordinates.
* For internal use, flat coordinates in combination with `opt_layout` are also accepted. * For internal use, flat coordinates in combination with `opt_layout` are also accepted.
* @param {GeometryLayout=} opt_layout Layout. * @param {import("./GeometryLayout.js").default=} opt_layout Layout.
*/ */
constructor(coordinates, opt_layout) { constructor(coordinates, opt_layout) {
super(); super();
@@ -167,7 +167,7 @@ class LinearRing extends SimpleGeometry {
/** /**
* Set the coordinates of the linear ring. * Set the coordinates of the linear ring.
* @param {!Array<import("../coordinate.js").Coordinate>} coordinates Coordinates. * @param {!Array<import("../coordinate.js").Coordinate>} coordinates Coordinates.
* @param {GeometryLayout=} opt_layout Layout. * @param {import("./GeometryLayout.js").default=} opt_layout Layout.
* @api * @api
*/ */
setCoordinates(coordinates, opt_layout) { setCoordinates(coordinates, opt_layout) {
+1 -1
View File
@@ -28,7 +28,7 @@ class MultiLineString extends SimpleGeometry {
* @param {Array<Array<import("../coordinate.js").Coordinate>|LineString>|Array<number>} coordinates * @param {Array<Array<import("../coordinate.js").Coordinate>|LineString>|Array<number>} coordinates
* Coordinates or LineString geometries. (For internal use, flat coordinates in * Coordinates or LineString geometries. (For internal use, flat coordinates in
* combination with `opt_layout` and `opt_ends` are also accepted.) * combination with `opt_layout` and `opt_ends` are also accepted.)
* @param {GeometryLayout=} opt_layout Layout. * @param {import("./GeometryLayout.js").default=} opt_layout Layout.
* @param {Array<number>=} opt_ends Flat coordinate ends for internal use. * @param {Array<number>=} opt_ends Flat coordinate ends for internal use.
*/ */
constructor(coordinates, opt_layout, opt_ends) { constructor(coordinates, opt_layout, opt_ends) {
+2 -2
View File
@@ -35,7 +35,7 @@ class MultiPolygon extends SimpleGeometry {
/** /**
* @param {Array<Array<Array<import("../coordinate.js").Coordinate>>|Polygon>|Array<number>} coordinates Coordinates. * @param {Array<Array<Array<import("../coordinate.js").Coordinate>>|Polygon>|Array<number>} coordinates Coordinates.
* For internal use, flat coordinates in combination with `opt_layout` and `opt_endss` are also accepted. * For internal use, flat coordinates in combination with `opt_layout` and `opt_endss` are also accepted.
* @param {GeometryLayout=} opt_layout Layout. * @param {import("./GeometryLayout.js").default=} opt_layout Layout.
* @param {Array<Array<number>>=} opt_endss Array of ends for internal use with flat coordinates. * @param {Array<Array<number>>=} opt_endss Array of ends for internal use with flat coordinates.
*/ */
constructor(coordinates, opt_layout, opt_endss) { constructor(coordinates, opt_layout, opt_endss) {
@@ -446,7 +446,7 @@ class MultiPolygon extends SimpleGeometry {
/** /**
* Set the coordinates of the multipolygon. * Set the coordinates of the multipolygon.
* @param {!Array<Array<Array<import("../coordinate.js").Coordinate>>>} coordinates Coordinates. * @param {!Array<Array<Array<import("../coordinate.js").Coordinate>>>} coordinates Coordinates.
* @param {GeometryLayout=} opt_layout Layout. * @param {import("./GeometryLayout.js").default=} opt_layout Layout.
* @api * @api
*/ */
setCoordinates(coordinates, opt_layout) { setCoordinates(coordinates, opt_layout) {
+2 -2
View File
@@ -35,7 +35,7 @@ class Polygon extends SimpleGeometry {
* an array of vertices' coordinates where the first coordinate and the last are * an array of vertices' coordinates where the first coordinate and the last are
* equivalent. (For internal use, flat coordinates in combination with * equivalent. (For internal use, flat coordinates in combination with
* `opt_layout` and `opt_ends` are also accepted.) * `opt_layout` and `opt_ends` are also accepted.)
* @param {GeometryLayout=} opt_layout Layout. * @param {import("./GeometryLayout.js").default=} opt_layout Layout.
* @param {Array<number>=} opt_ends Ends (for internal use with flat coordinates). * @param {Array<number>=} opt_ends Ends (for internal use with flat coordinates).
*/ */
constructor(coordinates, opt_layout, opt_ends) { constructor(coordinates, opt_layout, opt_ends) {
@@ -385,7 +385,7 @@ class Polygon extends SimpleGeometry {
/** /**
* Set the coordinates of the polygon. * Set the coordinates of the polygon.
* @param {!Array<Array<import("../coordinate.js").Coordinate>>} coordinates Coordinates. * @param {!Array<Array<import("../coordinate.js").Coordinate>>} coordinates Coordinates.
* @param {GeometryLayout=} opt_layout Layout. * @param {import("./GeometryLayout.js").default=} opt_layout Layout.
* @api * @api
*/ */
setCoordinates(coordinates, opt_layout) { setCoordinates(coordinates, opt_layout) {
+8 -8
View File
@@ -21,7 +21,7 @@ class SimpleGeometry extends Geometry {
/** /**
* @protected * @protected
* @type {GeometryLayout} * @type {import("./GeometryLayout.js").default}
*/ */
this.layout = GeometryLayout.XY; this.layout = GeometryLayout.XY;
@@ -90,7 +90,7 @@ class SimpleGeometry extends Geometry {
/** /**
* Return the {@link module:ol/geom/GeometryLayout layout} of the geometry. * Return the {@link module:ol/geom/GeometryLayout layout} of the geometry.
* @return {GeometryLayout} Layout. * @return {import("./GeometryLayout.js").default} Layout.
* @api * @api
*/ */
getLayout() { getLayout() {
@@ -152,7 +152,7 @@ class SimpleGeometry extends Geometry {
} }
/** /**
* @param {GeometryLayout} layout Layout. * @param {import("./GeometryLayout.js").default} layout Layout.
* @param {Array<number>} flatCoordinates Flat coordinates. * @param {Array<number>} flatCoordinates Flat coordinates.
*/ */
setFlatCoordinates(layout, flatCoordinates) { setFlatCoordinates(layout, flatCoordinates) {
@@ -164,14 +164,14 @@ class SimpleGeometry extends Geometry {
/** /**
* @abstract * @abstract
* @param {!Array<*>} coordinates Coordinates. * @param {!Array<*>} coordinates Coordinates.
* @param {GeometryLayout=} opt_layout Layout. * @param {import("./GeometryLayout.js").default=} opt_layout Layout.
*/ */
setCoordinates(coordinates, opt_layout) { setCoordinates(coordinates, opt_layout) {
abstract(); abstract();
} }
/** /**
* @param {GeometryLayout|undefined} layout Layout. * @param {import("./GeometryLayout.js").default|undefined} layout Layout.
* @param {Array<*>} coordinates Coordinates. * @param {Array<*>} coordinates Coordinates.
* @param {number} nesting Nesting. * @param {number} nesting Nesting.
* @protected * @protected
@@ -300,7 +300,7 @@ class SimpleGeometry extends Geometry {
/** /**
* @param {number} stride Stride. * @param {number} stride Stride.
* @return {GeometryLayout} layout Layout. * @return {import("./GeometryLayout.js").default} layout Layout.
*/ */
function getLayoutForStride(stride) { function getLayoutForStride(stride) {
let layout; let layout;
@@ -311,11 +311,11 @@ function getLayoutForStride(stride) {
} else if (stride == 4) { } else if (stride == 4) {
layout = GeometryLayout.XYZM; layout = GeometryLayout.XYZM;
} }
return /** @type {GeometryLayout} */ (layout); return /** @type {import("./GeometryLayout.js").default} */ (layout);
} }
/** /**
* @param {GeometryLayout} layout Layout. * @param {import("./GeometryLayout.js").default} layout Layout.
* @return {number} Stride. * @return {number} Stride.
*/ */
export function getStrideForLayout(layout) { export function getStrideForLayout(layout) {
+4 -4
View File
@@ -34,7 +34,7 @@ import {squaredDistance as squaredCoordinateDistance} from '../coordinate.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {GeometryType} type Geometry type of * @property {import("../geom/GeometryType.js").default} type Geometry type of
* the geometries being drawn with this instance. * the geometries being drawn with this instance.
* @property {number} [clickTolerance=6] The maximum distance in pixels between * @property {number} [clickTolerance=6] The maximum distance in pixels between
* "down" and "up" for a "up" event to be considered a "click" event and * "down" and "up" for a "up" event to be considered a "click" event and
@@ -244,10 +244,10 @@ class Draw extends PointerInteraction {
/** /**
* Geometry type. * Geometry type.
* @type {GeometryType} * @type {import("../geom/GeometryType.js").default}
* @private * @private
*/ */
this.type_ = /** @type {GeometryType} */ (options.type); this.type_ = /** @type {import("../geom/GeometryType.js").default} */ (options.type);
/** /**
* Drawing mode (derived from geometry type. * Drawing mode (derived from geometry type.
@@ -1166,7 +1166,7 @@ export function createBox() {
/** /**
* Get the drawing mode. The mode for mult-part geometries is the same as for * Get the drawing mode. The mode for mult-part geometries is the same as for
* their single-part cousins. * their single-part cousins.
* @param {GeometryType} type Geometry type. * @param {import("../geom/GeometryType.js").default} type Geometry type.
* @return {Mode} Drawing mode. * @return {Mode} Drawing mode.
*/ */
function getMode(type) { function getMode(type) {
+1 -1
View File
@@ -46,7 +46,7 @@ import {listen, unlistenByKey} from '../events.js';
* @typedef {Object} State * @typedef {Object} State
* @property {import("./Layer.js").default} layer * @property {import("./Layer.js").default} layer
* @property {number} opacity Opacity, the value is rounded to two digits to appear after the decimal point. * @property {number} opacity Opacity, the value is rounded to two digits to appear after the decimal point.
* @property {SourceState} sourceState * @property {import("../source/State.js").default} sourceState
* @property {boolean} visible * @property {boolean} visible
* @property {boolean} managed * @property {boolean} managed
* @property {import("../extent.js").Extent} [extent] * @property {import("../extent.js").Extent} [extent]
+2 -2
View File
@@ -104,7 +104,7 @@ class VectorTileLayer extends BaseVectorLayer {
/** /**
* @private * @private
* @type {VectorTileRenderType} * @type {import("./VectorTileRenderType.js").default}
*/ */
this.renderMode_ = renderMode; this.renderMode_ = renderMode;
@@ -144,7 +144,7 @@ class VectorTileLayer extends BaseVectorLayer {
} }
/** /**
* @return {VectorTileRenderType} The render mode. * @return {import("./VectorTileRenderType.js").default} The render mode.
*/ */
getRenderMode() { getRenderMode() {
return this.renderMode_; return this.renderMode_;
+1 -1
View File
@@ -181,7 +181,7 @@ export function get(projectionLike) {
* @param {ProjectionLike} projection The projection. * @param {ProjectionLike} projection The projection.
* @param {number} resolution Nominal resolution in projection units. * @param {number} resolution Nominal resolution in projection units.
* @param {import("./coordinate.js").Coordinate} point Point to find adjusted resolution at. * @param {import("./coordinate.js").Coordinate} point Point to find adjusted resolution at.
* @param {Units=} opt_units Units to get the point resolution in. * @param {import("./proj/Units.js").default=} opt_units Units to get the point resolution in.
* Default is the projection's units. * Default is the projection's units.
* @return {number} Point resolution. * @return {number} Point resolution.
* @api * @api
+3 -3
View File
@@ -34,7 +34,7 @@ const tmpTransform = createTransform();
*/ */
class RenderFeature { class RenderFeature {
/** /**
* @param {GeometryType} type Geometry type. * @param {import("../geom/GeometryType.js").default} type Geometry type.
* @param {Array<number>} flatCoordinates Flat coordinates. These always need * @param {Array<number>} flatCoordinates Flat coordinates. These always need
* to be right-handed for polygons. * to be right-handed for polygons.
* @param {Array<number>|Array<Array<number>>} ends Ends or Endss. * @param {Array<number>|Array<Array<number>>} ends Ends or Endss.
@@ -56,7 +56,7 @@ class RenderFeature {
/** /**
* @private * @private
* @type {GeometryType} * @type {import("../geom/GeometryType.js").default}
*/ */
this.type_ = type; this.type_ = type;
@@ -267,7 +267,7 @@ class RenderFeature {
/** /**
* Get the type of this feature's geometry. * Get the type of this feature's geometry.
* @return {GeometryType} Geometry type. * @return {import("../geom/GeometryType.js").default} Geometry type.
* @api * @api
*/ */
getType() { getType() {
+1 -1
View File
@@ -370,7 +370,7 @@ class CanvasBuilder extends VectorContext {
let begin = -1; let begin = -1;
for (i = 0; i < n; ++i) { for (i = 0; i < n; ++i) {
instruction = hitDetectionInstructions[i]; instruction = hitDetectionInstructions[i];
type = /** @type {CanvasInstruction} */ (instruction[0]); type = /** @type {import("./Instruction.js").default} */ (instruction[0]);
if (type == CanvasInstruction.END_GEOMETRY) { if (type == CanvasInstruction.END_GEOMETRY) {
begin = i; begin = i;
} else if (type == CanvasInstruction.BEGIN_GEOMETRY) { } else if (type == CanvasInstruction.BEGIN_GEOMETRY) {
+1 -1
View File
@@ -669,7 +669,7 @@ class Executor {
let x, y; let x, y;
while (i < ii) { while (i < ii) {
const instruction = instructions[i]; const instruction = instructions[i];
const type = /** @type {CanvasInstruction} */ (instruction[0]); const type = /** @type {import("./Instruction.js").default} */ (instruction[0]);
switch (type) { switch (type) {
case CanvasInstruction.BEGIN_GEOMETRY: case CanvasInstruction.BEGIN_GEOMETRY:
feature = /** @type {import("../../Feature.js").FeatureLike} */ (instruction[1]); feature = /** @type {import("../../Feature.js").FeatureLike} */ (instruction[1]);
+6 -6
View File
@@ -16,7 +16,7 @@ import {transform2D} from '../../geom/flat/transform.js';
/** /**
* @const * @const
* @type {Array<BuilderType>} * @type {Array<import("./BuilderType.js").default>}
*/ */
const ORDER = [ const ORDER = [
BuilderType.POLYGON, BuilderType.POLYGON,
@@ -36,7 +36,7 @@ class ExecutorGroup {
* @param {number} resolution Resolution. * @param {number} resolution Resolution.
* @param {number} pixelRatio Pixel ratio. * @param {number} pixelRatio Pixel ratio.
* @param {boolean} overlaps The executor group can have overlapping geometries. * @param {boolean} overlaps The executor group can have overlapping geometries.
* @param {!Object<string, !Object<BuilderType, import("./Builder.js").SerializableInstructions>>} allInstructions * @param {!Object<string, !Object<import("./BuilderType.js").default, import("./Builder.js").SerializableInstructions>>} allInstructions
* The serializable instructions. * The serializable instructions.
* @param {number=} opt_renderBuffer Optional rendering buffer. * @param {number=} opt_renderBuffer Optional rendering buffer.
*/ */
@@ -80,7 +80,7 @@ class ExecutorGroup {
/** /**
* @private * @private
* @type {!Object<string, !Object<BuilderType, import("./Executor").default>>} * @type {!Object<string, !Object<import("./BuilderType.js").default, import("./Executor").default>>}
*/ */
this.executorsByZIndex_ = {}; this.executorsByZIndex_ = {};
@@ -116,7 +116,7 @@ class ExecutorGroup {
/** /**
* Create executors and populate them using the provided instructions. * Create executors and populate them using the provided instructions.
* @private * @private
* @param {!Object<string, !Object<BuilderType, import("./Builder.js").SerializableInstructions>>} allInstructions The serializable instructions * @param {!Object<string, !Object<import("./BuilderType.js").default, import("./Builder.js").SerializableInstructions>>} allInstructions The serializable instructions
*/ */
createExecutors_(allInstructions) { createExecutors_(allInstructions) {
for (const zIndex in allInstructions) { for (const zIndex in allInstructions) {
@@ -139,7 +139,7 @@ class ExecutorGroup {
} }
/** /**
* @param {Array<BuilderType>} executors Executors. * @param {Array<import("./BuilderType.js").default>} executors Executors.
* @return {boolean} Has executors of the provided types. * @return {boolean} Has executors of the provided types.
*/ */
hasExecutors(executors) { hasExecutors(executors) {
@@ -313,7 +313,7 @@ class ExecutorGroup {
* @param {import("../../transform.js").Transform} transform Transform. * @param {import("../../transform.js").Transform} transform Transform.
* @param {number} viewRotation View rotation. * @param {number} viewRotation View rotation.
* @param {boolean} snapToPixel Snap point symbols and test to integer pixel. * @param {boolean} snapToPixel Snap point symbols and test to integer pixel.
* @param {Array<BuilderType>=} opt_builderTypes Ordered replay types to replay. * @param {Array<import("./BuilderType.js").default>=} opt_builderTypes Ordered replay types to replay.
* Default is {@link module:ol/render/replay~ORDER} * Default is {@link module:ol/render/replay~ORDER}
* @param {Object<string, import("../canvas.js").DeclutterGroup>=} opt_declutterReplays Declutter replays. * @param {Object<string, import("../canvas.js").DeclutterGroup>=} opt_declutterReplays Declutter replays.
*/ */
+1 -1
View File
@@ -41,7 +41,7 @@ import {toSize} from '../size.js';
* @property {number} [transition] * @property {number} [transition]
* @property {string} [url] Base URL of the IIIF Image service. * @property {string} [url] Base URL of the IIIF Image service.
* This should be the same as the IIIF Image ID. * This should be the same as the IIIF Image ID.
* @property {Versions} [version=Versions.VERSION2] Service's IIIF Image API version. * @property {import("../format/IIIFInfo.js").Versions} [version=Versions.VERSION2] Service's IIIF Image API version.
* @property {number} [zDirection=0] Indicate which resolution should be used * @property {number} [zDirection=0] Indicate which resolution should be used
* by a renderer if the view resolution does not match any resolution of the tile source. * by a renderer if the view resolution does not match any resolution of the tile source.
* If 0, the nearest resolution will be used. If 1, the nearest lower resolution * If 0, the nearest resolution will be used. If 1, the nearest lower resolution
+4 -4
View File
@@ -29,7 +29,7 @@ import {get as getProjection} from '../proj.js';
* @property {AttributionLike} [attributions] * @property {AttributionLike} [attributions]
* @property {boolean} [attributionsCollapsible=true] Attributions are collapsible. * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible.
* @property {import("../proj.js").ProjectionLike} [projection] Projection. Default is the view projection. * @property {import("../proj.js").ProjectionLike} [projection] Projection. Default is the view projection.
* @property {SourceState} [state='ready'] * @property {import("./State.js").default} [state='ready']
* @property {boolean} [wrapX=false] * @property {boolean} [wrapX=false]
*/ */
@@ -80,7 +80,7 @@ class Source extends BaseObject {
/** /**
* @private * @private
* @type {SourceState} * @type {import("./State.js").default}
*/ */
this.state_ = this.state_ =
options.state !== undefined ? options.state : SourceState.READY; options.state !== undefined ? options.state : SourceState.READY;
@@ -126,7 +126,7 @@ class Source extends BaseObject {
/** /**
* Get the state of the source, see {@link module:ol/source/State~State} for possible states. * Get the state of the source, see {@link module:ol/source/State~State} for possible states.
* @return {SourceState} State. * @return {import("./State.js").default} State.
* @api * @api
*/ */
getState() { getState() {
@@ -162,7 +162,7 @@ class Source extends BaseObject {
/** /**
* Set the state of the source. * Set the state of the source.
* @param {SourceState} state State. * @param {import("./State.js").default} state State.
* @protected * @protected
*/ */
setState(state) { setState(state) {
+1 -1
View File
@@ -26,7 +26,7 @@ import {jsonp as requestJSONP} from '../net.js';
export class CustomTile extends Tile { export class CustomTile extends Tile {
/** /**
* @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate. * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate.
* @param {TileState} state State. * @param {import("../TileState.js").default} state State.
* @param {string} src Image source URI. * @param {string} src Image source URI.
* @param {import("../extent.js").Extent} extent Extent of the tile. * @param {import("../extent.js").Extent} extent Extent of the tile.
* @param {boolean} preemptive Load the tile when visible (before it's needed). * @param {boolean} preemptive Load the tile when visible (before it's needed).
+1 -1
View File
@@ -25,7 +25,7 @@ export class CustomTile extends ImageTile {
/** /**
* @param {import("../size.js").Size} tileSize Full tile size. * @param {import("../size.js").Size} tileSize Full tile size.
* @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate. * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate.
* @param {TileState} state State. * @param {import("../TileState.js").default} state State.
* @param {string} src Image source URI. * @param {string} src Image source URI.
* @param {?string} crossOrigin Cross origin. * @param {?string} crossOrigin Cross origin.
* @param {import("../Tile.js").LoadFunction} tileLoadFunction Tile load function. * @param {import("../Tile.js").LoadFunction} tileLoadFunction Tile load function.
+2 -2
View File
@@ -57,7 +57,7 @@ export function wrapX(tileGrid, tileCoord, projection) {
* DEFAULT_MAX_ZOOM). * DEFAULT_MAX_ZOOM).
* @param {number|import("./size.js").Size=} opt_tileSize Tile size (default uses * @param {number|import("./size.js").Size=} opt_tileSize Tile size (default uses
* DEFAULT_TILE_SIZE). * DEFAULT_TILE_SIZE).
* @param {Corner=} opt_corner Extent corner (default is `'top-left'`). * @param {import("./extent/Corner.js").default=} opt_corner Extent corner (default is `'top-left'`).
* @return {!TileGrid} TileGrid instance. * @return {!TileGrid} TileGrid instance.
*/ */
export function createForExtent(extent, opt_maxZoom, opt_tileSize, opt_corner) { export function createForExtent(extent, opt_maxZoom, opt_tileSize, opt_corner) {
@@ -153,7 +153,7 @@ function resolutionsFromExtent(
* DEFAULT_MAX_ZOOM). * DEFAULT_MAX_ZOOM).
* @param {number|import("./size.js").Size=} opt_tileSize Tile size (default uses * @param {number|import("./size.js").Size=} opt_tileSize Tile size (default uses
* DEFAULT_TILE_SIZE). * DEFAULT_TILE_SIZE).
* @param {Corner=} opt_corner Extent corner (default is `'top-left'`). * @param {import("./extent/Corner.js").default=} opt_corner Extent corner (default is `'top-left'`).
* @return {!TileGrid} TileGrid instance. * @return {!TileGrid} TileGrid instance.
*/ */
export function createForProjection( export function createForProjection(