17
package.json
17
package.json
@@ -21,6 +21,7 @@
|
||||
"build-legacy": "rm -rf build && npm run build-index && rollup --config config/rollup.js && cleancss --source-map src/ol/ol.css -o build/ol.css",
|
||||
"copy-css": "cp src/ol/ol.css build/ol/ol.css",
|
||||
"transpile": "rm -rf build/ol && mkdir -p build && buble --input src/ol --output build/ol --no modules --sourcemap",
|
||||
"typecheck": "tsc --pretty",
|
||||
"apidoc": "jsdoc config/jsdoc/api/index.md -c config/jsdoc/api/conf.json -P package.json -d build/apidoc"
|
||||
},
|
||||
"main": "index.js",
|
||||
@@ -38,6 +39,7 @@
|
||||
"rbush": "2.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@openlayers/eslint-plugin": "^4.0.0-beta.1",
|
||||
"buble": "^0.19.3",
|
||||
"buble-loader": "^0.5.1",
|
||||
"chaikin-smooth": "^1.0.4",
|
||||
@@ -74,6 +76,7 @@
|
||||
"rollup-plugin-sourcemaps": "0.4.2",
|
||||
"rollup-plugin-uglify": "5.0.2",
|
||||
"sinon": "^6.0.0",
|
||||
"typescript": "^3.1.0-dev.20180905",
|
||||
"uglifyjs-webpack-plugin": "^1.2.5",
|
||||
"url-polyfill": "^1.0.13",
|
||||
"walk": "^2.3.9",
|
||||
@@ -82,7 +85,19 @@
|
||||
"webpack-dev-server": "^3.1.4"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "openlayers"
|
||||
"extends": "openlayers",
|
||||
"plugins": [
|
||||
"@openlayers"
|
||||
],
|
||||
"rules": {
|
||||
"valid-jsdoc": "off",
|
||||
"@openlayers/valid-tsdoc": [
|
||||
"error",
|
||||
{
|
||||
"requireReturn": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sideEffects": [
|
||||
"ol.css"
|
||||
|
||||
@@ -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<T>=} 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<T>} arr Array.
|
||||
* @return {module:ol/Collection<T>} This collection.
|
||||
* @return {import("./Collection.js").default<T>} This collection.
|
||||
* @api
|
||||
*/
|
||||
extend(arr) {
|
||||
|
||||
@@ -54,7 +54,7 @@ import Style from './style/Style.js';
|
||||
*/
|
||||
class Feature extends BaseObject {
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry|Object<string, *>=} opt_geometryOrProperties
|
||||
* @param {import("./geom/Geometry.js").default|Object<string, *>=} 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>|module:ol/style/Style~StyleFunction}
|
||||
* @type {import("./style/Style.js").default|Array<import("./style/Style.js").default>|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>|module:ol/style/Style~StyleFunction} The feature style.
|
||||
* @return {import("./style/Style.js").default|Array<import("./style/Style.js").default>|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>|module:ol/style/Style~StyleFunction} style Style for this feature.
|
||||
* @param {import("./style/Style.js").default|Array<import("./style/Style.js").default>|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>|!module:ol/style/Style} obj
|
||||
* @param {import("./style/Style.js").StyleFunction|!Array<import("./style/Style.js").default>|!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<module:ol/style/Style>}
|
||||
* @type {Array<import("./style/Style.js").default>}
|
||||
*/
|
||||
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() {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<module:ol/geom/LineString>}
|
||||
* @type {Array<import("./geom/LineString.js").default>}
|
||||
* @private
|
||||
*/
|
||||
this.meridians_ = [];
|
||||
|
||||
/**
|
||||
* @type {Array<module:ol/geom/LineString>}
|
||||
* @type {Array<import("./geom/LineString.js").default>}
|
||||
* @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<module:ol/Graticule~GraticuleLabelDataType>}
|
||||
* @type {Array<GraticuleLabelDataType>}
|
||||
* @private
|
||||
*/
|
||||
this.meridiansLabels_ = null;
|
||||
|
||||
/**
|
||||
* @type {Array<module:ol/Graticule~GraticuleLabelDataType>}
|
||||
* @type {Array<GraticuleLabelDataType>}
|
||||
* @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<module:ol/geom/LineString>} The meridians.
|
||||
* @return {Array<import("./geom/LineString.js").default>} 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<module:ol/geom/LineString>} The parallels.
|
||||
* @return {Array<import("./geom/LineString.js").default>} 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) {
|
||||
|
||||
@@ -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<module:ol/events~EventsKey>}
|
||||
* @type {Array<import("./events.js").EventsKey>}
|
||||
*/
|
||||
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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<module:ol/events~EventsKey>}
|
||||
* @type {Array<import("./events.js").EventsKey>}
|
||||
*/
|
||||
this.imageListenerKeys_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/Tile~LoadFunction}
|
||||
* @type {import("./Tile.js").LoadFunction}
|
||||
*/
|
||||
this.tileLoadFunction_ = tileLoadFunction;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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<module:ol/events~EventsKey>}
|
||||
* @type {!Array<import("./events.js").EventsKey>}
|
||||
* @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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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<string>} type The event type or array of event types.
|
||||
* @param {function(?): ?} listener The listener function.
|
||||
* @return {module:ol/events~EventsKey|Array<module:ol/events~EventsKey>} Unique key for the listener. If
|
||||
* @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} 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<string>} type The event type or array of event types.
|
||||
* @param {function(?): ?} listener The listener function.
|
||||
* @return {module:ol/events~EventsKey|Array<module:ol/events~EventsKey>} Unique key for the listener. If
|
||||
* @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} 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<module:ol/events~EventsKey>} key The key returned by `on()`
|
||||
* @param {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} 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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<number, module:ol/layer/Layer~State>} layerStates
|
||||
* @property {Array<module:ol/layer/Layer~State>} layerStatesArray
|
||||
* @property {module:ol/transform~Transform} pixelToCoordinateTransform
|
||||
* @property {Array<module:ol/PluggableMap~PostRenderFunction>} postRenderFunctions
|
||||
* @property {module:ol/size~Size} size
|
||||
* @property {Object<number, import("./layer/Layer.js").State>} layerStates
|
||||
* @property {Array<import("./layer/Layer.js").State>} layerStatesArray
|
||||
* @property {import("./transform.js").Transform} pixelToCoordinateTransform
|
||||
* @property {Array<PostRenderFunction>} postRenderFunctions
|
||||
* @property {import("./size.js").Size} size
|
||||
* @property {!Object<string, boolean>} skippedFeatureUids
|
||||
* @property {module:ol/TileQueue} tileQueue
|
||||
* @property {Object<string, Object<string, module:ol/TileRange>>} usedTiles
|
||||
* @property {import("./TileQueue.js").default} tileQueue
|
||||
* @property {Object<string, Object<string, import("./TileRange.js").default>>} usedTiles
|
||||
* @property {Array<number>} viewHints
|
||||
* @property {!Object<string, Object<string, boolean>>} 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<module:ol/control/Control>} [controls]
|
||||
* @property {module:ol/Collection<module:ol/interaction/Interaction>} [interactions]
|
||||
* @property {import("./Collection.js").default<import("./control/Control.js").default>} [controls]
|
||||
* @property {import("./Collection.js").default<import("./interaction/Interaction.js").default>} [interactions]
|
||||
* @property {HTMLElement|Document} keyboardEventTarget
|
||||
* @property {module:ol/Collection<module:ol/Overlay>} overlays
|
||||
* @property {import("./Collection.js").default<import("./Overlay.js").default>} overlays
|
||||
* @property {Object<string, *>} 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<module:ol/control/Control>|Array<module:ol/control/Control>} [controls]
|
||||
* @property {import("./Collection.js").default<import("./control/Control.js").default>|Array<import("./control/Control.js").default>} [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<module:ol/interaction/Interaction>|Array<module:ol/interaction/Interaction>} [interactions]
|
||||
* @property {import("./Collection.js").default<import("./interaction/Interaction.js").default>|Array<import("./interaction/Interaction.js").default>} [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/layer/Base>|module:ol/Collection<module:ol/layer/Base>} [layers]
|
||||
* @property {Array<import("./layer/Base.js").default>|import("./Collection.js").default<import("./layer/Base.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<module:ol/Overlay>|Array<module:ol/Overlay>} [overlays]
|
||||
* @property {import("./Collection.js").default<import("./Overlay.js").default>|Array<import("./Overlay.js").default>} [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<module:ol/events~EventsKey>}
|
||||
* @type {Array<import("./events.js").EventsKey>}
|
||||
*/
|
||||
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<module:ol/events~EventsKey>}
|
||||
* @type {Array<import("./events.js").EventsKey>}
|
||||
*/
|
||||
this.keyHandlerKeys_ = null;
|
||||
|
||||
@@ -312,19 +312,19 @@ class PluggableMap extends BaseObject {
|
||||
listen(this.viewport_, EventType.MOUSEWHEEL, this.handleBrowserEvent, this);
|
||||
|
||||
/**
|
||||
* @type {module:ol/Collection<module:ol/control/Control>}
|
||||
* @type {import("./Collection.js").default<import("./control/Control.js").default>}
|
||||
* @protected
|
||||
*/
|
||||
this.controls = optionsInternal.controls || new Collection();
|
||||
|
||||
/**
|
||||
* @type {module:ol/Collection<module:ol/interaction/Interaction>}
|
||||
* @type {import("./Collection.js").default<import("./interaction/Interaction.js").default>}
|
||||
* @protected
|
||||
*/
|
||||
this.interactions = optionsInternal.interactions || new Collection();
|
||||
|
||||
/**
|
||||
* @type {module:ol/Collection<module:ol/Overlay>}
|
||||
* @type {import("./Collection.js").default<import("./Overlay.js").default>}
|
||||
* @private
|
||||
*/
|
||||
this.overlays_ = optionsInternal.overlays;
|
||||
@@ -332,12 +332,12 @@ class PluggableMap extends BaseObject {
|
||||
/**
|
||||
* A lookup of overlays by id.
|
||||
* @private
|
||||
* @type {Object<string, module:ol/Overlay>}
|
||||
* @type {Object<string, import("./Overlay.js").default>}
|
||||
*/
|
||||
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<module:ol/PluggableMap~PostRenderFunction>}
|
||||
* @type {!Array<PostRenderFunction>}
|
||||
*/
|
||||
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<module:ol/Feature|module:ol/render/Feature>} The detected features or
|
||||
* @param {import("./pixel.js").Pixel} pixel Pixel.
|
||||
* @param {AtPixelOptions=} opt_options Optional options.
|
||||
* @return {Array<import("./Feature.js").default|import("./render/Feature.js").default>} 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<module:ol/control/Control>} Controls.
|
||||
* @return {import("./Collection.js").default<import("./control/Control.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<module:ol/Overlay>} Overlays.
|
||||
* @return {import("./Collection.js").default<import("./Overlay.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<module:ol/interaction/Interaction>} Interactions.
|
||||
* @return {import("./Collection.js").default<import("./interaction/Interaction.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<module:ol/layer/Base>} Layers.
|
||||
* @return {!import("./Collection.js").default<import("./layer/Base.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<module:ol/layer/Base>} layers Layers.
|
||||
* @param {Array<import("./layer/Base.js").default>} layers Layers.
|
||||
* @return {boolean} Layers have sources that are still loading.
|
||||
*/
|
||||
function getLoading(layers) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -16,7 +16,7 @@ class TileCache extends LRUCache {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {!Object<string, module:ol/TileRange>} usedTiles Used tiles.
|
||||
* @param {!Object<string, import("./TileRange.js").default>} usedTiles Used tiles.
|
||||
*/
|
||||
expireCache(usedTiles) {
|
||||
while (this.canExpireCache()) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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<string, module:ol/VectorTile>} 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<string, import("./VectorTile.js").default>} 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<string, module:ol/VectorImageTile~ReplayState>}
|
||||
* @type {!Object<string, ReplayState>}
|
||||
*/
|
||||
this.replayState_ = {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object<string, module:ol/VectorTile>}
|
||||
* @type {Object<string, import("./VectorTile.js").default>}
|
||||
*/
|
||||
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<module:ol/events~EventsKey>}
|
||||
* @type {Array<import("./events.js").EventsKey>}
|
||||
*/
|
||||
this.loadListenerKeys_ = [];
|
||||
|
||||
/**
|
||||
* @type {Array<module:ol/events~EventsKey>}
|
||||
* @type {Array<import("./events.js").EventsKey>}
|
||||
*/
|
||||
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) {
|
||||
|
||||
@@ -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<module:ol/Feature>}
|
||||
* @type {Array<import("./Feature.js").default>}
|
||||
*/
|
||||
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<string, module:ol/render/ReplayGroup>}
|
||||
* @type {Object<string, import("./render/ReplayGroup.js").default>}
|
||||
*/
|
||||
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<module:ol/Feature|module:ol/render/Feature>} Features.
|
||||
* @return {Array<import("./Feature.js").default|import("./render/Feature.js").default>} 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<module:ol/Feature>} features The loaded features.
|
||||
* @param {module:ol/proj/Projection} dataProjection Data projection.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Array<import("./Feature.js").default>} 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<module:ol/Feature>} features Features.
|
||||
* @param {Array<import("./Feature.js").default>} 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) {
|
||||
|
||||
120
src/ol/View.js
120
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<number>} [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<Array<module:ol/View~Animation>>}
|
||||
* @type {Array<Array<Animation>>}
|
||||
*/
|
||||
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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<string, module:ol/color~Color>}
|
||||
* @type {Object<string, Color>}
|
||||
*/
|
||||
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) {
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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<string>} 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) {
|
||||
|
||||
@@ -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<module:ol/events~EventsKey>}
|
||||
* @type {!Array<import("../events.js").EventsKey>}
|
||||
*/
|
||||
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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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/layer/Layer>|module:ol/Collection<module:ol/layer/Layer>} [layers]
|
||||
* @property {Array<import("../layer/Layer.js").default>|import("../Collection.js").default<import("../layer/Layer.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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<module:ol/control/Control>}
|
||||
* @return {import("../Collection.js").default<import("./Control.js").default>}
|
||||
* Controls.
|
||||
* @function module:ol/control.defaults
|
||||
* @api
|
||||
|
||||
@@ -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<module:ol/coordinate~Coordinate>} segment The two coordinates
|
||||
* @param {Coordinate} coordinate The coordinate.
|
||||
* @param {Array<Coordinate>} 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<module:ol/coordinate~Coordinate>} segment Line segment (2
|
||||
* @param {Coordinate} coordinate Coordinate of the point.
|
||||
* @param {Array<Coordinate>} 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.
|
||||
|
||||
@@ -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<!module:ol/events~EventsKey>} listeners Array of listeners.
|
||||
* @param {!Array<!EventsKey>} 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<module:ol/events~EventsKey>|undefined} Listeners.
|
||||
* @return {Array<EventsKey>|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<string, Array<module:ol/events~EventsKey>>} Map of
|
||||
* @param {import("./events/Target.js").EventTargetLike} target Target.
|
||||
* @return {!Object<string, Array<EventsKey>>} 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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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<string, Array<module:ol/events~ListenerFunction>>}
|
||||
* @type {!Object<string, Array<import("../events.js").ListenerFunction>>}
|
||||
*/
|
||||
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<module:ol/events~ListenerFunction>} Listeners.
|
||||
* @return {Array<import("../events.js").ListenerFunction>} 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];
|
||||
|
||||
@@ -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. `<div id="map" tabindex="1">`.
|
||||
*
|
||||
* @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 `<input>`-,
|
||||
* `<select>`- or `<textarea>`-element, `false` otherwise.
|
||||
*
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True only if the target element is not editable.
|
||||
* @api
|
||||
*/
|
||||
@@ -221,7 +221,7 @@ export const targetNotEditable = function(mapBrowserEvent) {
|
||||
/**
|
||||
* Return `true` if the event originates from a mouse device.
|
||||
*
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the event originates from a mouse device.
|
||||
* @api
|
||||
*/
|
||||
@@ -229,7 +229,7 @@ export const mouseOnly = function(mapBrowserEvent) {
|
||||
assert(mapBrowserEvent.pointerEvent, 56); // mapBrowserEvent must originate from a pointer event
|
||||
// see http://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
|
||||
return (
|
||||
/** @type {module:ol/MapBrowserEvent} */ (mapBrowserEvent).pointerEvent.pointerType == 'mouse'
|
||||
/** @type {import("../MapBrowserEvent.js").default} */ (mapBrowserEvent).pointerEvent.pointerType == 'mouse'
|
||||
);
|
||||
};
|
||||
|
||||
@@ -239,7 +239,7 @@ export const mouseOnly = function(mapBrowserEvent) {
|
||||
* contact with the surface or if the left mouse button is pressed.
|
||||
* See http://www.w3.org/TR/pointerevents/#button-states.
|
||||
*
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the event originates from a primary pointer.
|
||||
* @api
|
||||
*/
|
||||
|
||||
200
src/ol/extent.js
200
src/ol/extent.js
@@ -15,8 +15,8 @@ import Relationship from './extent/Relationship.js';
|
||||
/**
|
||||
* Build an extent that includes all given coordinates.
|
||||
*
|
||||
* @param {Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @return {module:ol/extent~Extent} Bounding extent.
|
||||
* @param {Array<import("./coordinate.js").Coordinate>} coordinates Coordinates.
|
||||
* @return {Extent} Bounding extent.
|
||||
* @api
|
||||
*/
|
||||
export function boundingExtent(coordinates) {
|
||||
@@ -31,9 +31,9 @@ export function boundingExtent(coordinates) {
|
||||
/**
|
||||
* @param {Array<number>} xs Xs.
|
||||
* @param {Array<number>} ys Ys.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
|
||||
* @param {Extent=} opt_extent Destination extent.
|
||||
* @private
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @return {Extent} Extent.
|
||||
*/
|
||||
function _boundingExtentXYs(xs, ys, opt_extent) {
|
||||
const minX = Math.min.apply(null, xs);
|
||||
@@ -46,10 +46,10 @@ function _boundingExtentXYs(xs, ys, opt_extent) {
|
||||
|
||||
/**
|
||||
* Return extent increased by the provided value.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Extent} extent Extent.
|
||||
* @param {number} value The amount by which the extent should be buffered.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @param {Extent=} opt_extent Extent.
|
||||
* @return {Extent} Extent.
|
||||
* @api
|
||||
*/
|
||||
export function buffer(extent, value, opt_extent) {
|
||||
@@ -73,9 +73,9 @@ export function buffer(extent, value, opt_extent) {
|
||||
/**
|
||||
* Creates a clone of an extent.
|
||||
*
|
||||
* @param {module:ol/extent~Extent} extent Extent to clone.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} The clone.
|
||||
* @param {Extent} extent Extent to clone.
|
||||
* @param {Extent=} opt_extent Extent.
|
||||
* @return {Extent} The clone.
|
||||
*/
|
||||
export function clone(extent, opt_extent) {
|
||||
if (opt_extent) {
|
||||
@@ -91,7 +91,7 @@ export function clone(extent, opt_extent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Extent} extent Extent.
|
||||
* @param {number} x X.
|
||||
* @param {number} y Y.
|
||||
* @return {number} Closest squared distance.
|
||||
@@ -119,8 +119,8 @@ export function closestSquaredDistanceXY(extent, x, y) {
|
||||
/**
|
||||
* Check if the passed coordinate is contained or on the edge of the extent.
|
||||
*
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {Extent} extent Extent.
|
||||
* @param {import("./coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @return {boolean} The coordinate is contained in the extent.
|
||||
* @api
|
||||
*/
|
||||
@@ -135,8 +135,8 @@ export function containsCoordinate(extent, coordinate) {
|
||||
* An extent is deemed contained if it lies completely within the other extent,
|
||||
* including if they share one or more edges.
|
||||
*
|
||||
* @param {module:ol/extent~Extent} extent1 Extent 1.
|
||||
* @param {module:ol/extent~Extent} extent2 Extent 2.
|
||||
* @param {Extent} extent1 Extent 1.
|
||||
* @param {Extent} extent2 Extent 2.
|
||||
* @return {boolean} The second extent is contained by or on the edge of the
|
||||
* first.
|
||||
* @api
|
||||
@@ -150,7 +150,7 @@ export function containsExtent(extent1, extent2) {
|
||||
/**
|
||||
* Check if the passed coordinate is contained or on the edge of the extent.
|
||||
*
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Extent} extent Extent.
|
||||
* @param {number} x X coordinate.
|
||||
* @param {number} y Y coordinate.
|
||||
* @return {boolean} The x, y values are contained in the extent.
|
||||
@@ -163,10 +163,10 @@ export function containsXY(extent, x, y) {
|
||||
|
||||
/**
|
||||
* Get the relationship between a coordinate and extent.
|
||||
* @param {module:ol/extent~Extent} extent The extent.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate The coordinate.
|
||||
* @return {module:ol/extent/Relationship} The relationship (bitwise compare with
|
||||
* module:ol/extent/Relationship~Relationship).
|
||||
* @param {Extent} extent The extent.
|
||||
* @param {import("./coordinate.js").Coordinate} coordinate The coordinate.
|
||||
* @return {import("./extent/Relationship.js").default} The relationship (bitwise compare with
|
||||
* import("./extent/Relationship.js").Relationship).
|
||||
*/
|
||||
export function coordinateRelationship(extent, coordinate) {
|
||||
const minX = extent[0];
|
||||
@@ -195,7 +195,7 @@ export function coordinateRelationship(extent, coordinate) {
|
||||
|
||||
/**
|
||||
* Create an empty extent.
|
||||
* @return {module:ol/extent~Extent} Empty extent.
|
||||
* @return {Extent} Empty extent.
|
||||
* @api
|
||||
*/
|
||||
export function createEmpty() {
|
||||
@@ -209,8 +209,8 @@ export function createEmpty() {
|
||||
* @param {number} minY Minimum Y.
|
||||
* @param {number} maxX Maximum X.
|
||||
* @param {number} maxY Maximum Y.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @param {Extent=} opt_extent Destination extent.
|
||||
* @return {Extent} Extent.
|
||||
*/
|
||||
export function createOrUpdate(minX, minY, maxX, maxY, opt_extent) {
|
||||
if (opt_extent) {
|
||||
@@ -227,8 +227,8 @@ export function createOrUpdate(minX, minY, maxX, maxY, opt_extent) {
|
||||
|
||||
/**
|
||||
* Create a new empty extent or make the provided one empty.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @param {Extent=} opt_extent Extent.
|
||||
* @return {Extent} Extent.
|
||||
*/
|
||||
export function createOrUpdateEmpty(opt_extent) {
|
||||
return createOrUpdate(
|
||||
@@ -237,9 +237,9 @@ export function createOrUpdateEmpty(opt_extent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @param {import("./coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {Extent=} opt_extent Extent.
|
||||
* @return {Extent} Extent.
|
||||
*/
|
||||
export function createOrUpdateFromCoordinate(coordinate, opt_extent) {
|
||||
const x = coordinate[0];
|
||||
@@ -249,9 +249,9 @@ export function createOrUpdateFromCoordinate(coordinate, opt_extent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @param {Array<import("./coordinate.js").Coordinate>} coordinates Coordinates.
|
||||
* @param {Extent=} opt_extent Extent.
|
||||
* @return {Extent} Extent.
|
||||
*/
|
||||
export function createOrUpdateFromCoordinates(coordinates, opt_extent) {
|
||||
const extent = createOrUpdateEmpty(opt_extent);
|
||||
@@ -264,8 +264,8 @@ export function createOrUpdateFromCoordinates(coordinates, opt_extent) {
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @param {Extent=} opt_extent Extent.
|
||||
* @return {Extent} Extent.
|
||||
*/
|
||||
export function createOrUpdateFromFlatCoordinates(flatCoordinates, offset, end, stride, opt_extent) {
|
||||
const extent = createOrUpdateEmpty(opt_extent);
|
||||
@@ -273,9 +273,9 @@ export function createOrUpdateFromFlatCoordinates(flatCoordinates, offset, end,
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} rings Rings.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @param {Array<Array<import("./coordinate.js").Coordinate>>} rings Rings.
|
||||
* @param {Extent=} opt_extent Extent.
|
||||
* @return {Extent} Extent.
|
||||
*/
|
||||
export function createOrUpdateFromRings(rings, opt_extent) {
|
||||
const extent = createOrUpdateEmpty(opt_extent);
|
||||
@@ -285,8 +285,8 @@ export function createOrUpdateFromRings(rings, opt_extent) {
|
||||
|
||||
/**
|
||||
* Determine if two extents are equivalent.
|
||||
* @param {module:ol/extent~Extent} extent1 Extent 1.
|
||||
* @param {module:ol/extent~Extent} extent2 Extent 2.
|
||||
* @param {Extent} extent1 Extent 1.
|
||||
* @param {Extent} extent2 Extent 2.
|
||||
* @return {boolean} The two extents are equivalent.
|
||||
* @api
|
||||
*/
|
||||
@@ -298,9 +298,9 @@ export function equals(extent1, extent2) {
|
||||
|
||||
/**
|
||||
* Modify an extent to include another extent.
|
||||
* @param {module:ol/extent~Extent} extent1 The extent to be modified.
|
||||
* @param {module:ol/extent~Extent} extent2 The extent that will be included in the first.
|
||||
* @return {module:ol/extent~Extent} A reference to the first (extended) extent.
|
||||
* @param {Extent} extent1 The extent to be modified.
|
||||
* @param {Extent} extent2 The extent that will be included in the first.
|
||||
* @return {Extent} A reference to the first (extended) extent.
|
||||
* @api
|
||||
*/
|
||||
export function extend(extent1, extent2) {
|
||||
@@ -321,8 +321,8 @@ export function extend(extent1, extent2) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {Extent} extent Extent.
|
||||
* @param {import("./coordinate.js").Coordinate} coordinate Coordinate.
|
||||
*/
|
||||
export function extendCoordinate(extent, coordinate) {
|
||||
if (coordinate[0] < extent[0]) {
|
||||
@@ -341,9 +341,9 @@ export function extendCoordinate(extent, coordinate) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @param {Extent} extent Extent.
|
||||
* @param {Array<import("./coordinate.js").Coordinate>} coordinates Coordinates.
|
||||
* @return {Extent} Extent.
|
||||
*/
|
||||
export function extendCoordinates(extent, coordinates) {
|
||||
for (let i = 0, ii = coordinates.length; i < ii; ++i) {
|
||||
@@ -354,12 +354,12 @@ export function extendCoordinates(extent, coordinates) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Extent} extent Extent.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @return {Extent} Extent.
|
||||
*/
|
||||
export function extendFlatCoordinates(extent, flatCoordinates, offset, end, stride) {
|
||||
for (; offset < end; offset += stride) {
|
||||
@@ -370,9 +370,9 @@ export function extendFlatCoordinates(extent, flatCoordinates, offset, end, stri
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} rings Rings.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @param {Extent} extent Extent.
|
||||
* @param {Array<Array<import("./coordinate.js").Coordinate>>} rings Rings.
|
||||
* @return {Extent} Extent.
|
||||
*/
|
||||
export function extendRings(extent, rings) {
|
||||
for (let i = 0, ii = rings.length; i < ii; ++i) {
|
||||
@@ -383,7 +383,7 @@ export function extendRings(extent, rings) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Extent} extent Extent.
|
||||
* @param {number} x X.
|
||||
* @param {number} y Y.
|
||||
*/
|
||||
@@ -399,8 +399,8 @@ export function extendXY(extent, x, y) {
|
||||
* This function calls `callback` for each corner of the extent. If the
|
||||
* callback returns a truthy value the function returns that value
|
||||
* immediately. Otherwise the function returns `false`.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {function(this:T, module:ol/coordinate~Coordinate): S} callback Callback.
|
||||
* @param {Extent} extent Extent.
|
||||
* @param {function(this:T, import("./coordinate.js").Coordinate): S} callback Callback.
|
||||
* @param {T=} opt_this Value to use as `this` when executing `callback`.
|
||||
* @return {S|boolean} Value.
|
||||
* @template S, T
|
||||
@@ -429,7 +429,7 @@ export function forEachCorner(extent, callback, opt_this) {
|
||||
|
||||
/**
|
||||
* Get the size of an extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Extent} extent Extent.
|
||||
* @return {number} Area.
|
||||
* @api
|
||||
*/
|
||||
@@ -444,8 +444,8 @@ export function getArea(extent) {
|
||||
|
||||
/**
|
||||
* Get the bottom left coordinate of an extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {module:ol/coordinate~Coordinate} Bottom left coordinate.
|
||||
* @param {Extent} extent Extent.
|
||||
* @return {import("./coordinate.js").Coordinate} Bottom left coordinate.
|
||||
* @api
|
||||
*/
|
||||
export function getBottomLeft(extent) {
|
||||
@@ -455,8 +455,8 @@ export function getBottomLeft(extent) {
|
||||
|
||||
/**
|
||||
* Get the bottom right coordinate of an extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {module:ol/coordinate~Coordinate} Bottom right coordinate.
|
||||
* @param {Extent} extent Extent.
|
||||
* @return {import("./coordinate.js").Coordinate} Bottom right coordinate.
|
||||
* @api
|
||||
*/
|
||||
export function getBottomRight(extent) {
|
||||
@@ -466,8 +466,8 @@ export function getBottomRight(extent) {
|
||||
|
||||
/**
|
||||
* Get the center coordinate of an extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {module:ol/coordinate~Coordinate} Center.
|
||||
* @param {Extent} extent Extent.
|
||||
* @return {import("./coordinate.js").Coordinate} Center.
|
||||
* @api
|
||||
*/
|
||||
export function getCenter(extent) {
|
||||
@@ -477,9 +477,9 @@ export function getCenter(extent) {
|
||||
|
||||
/**
|
||||
* Get a corner coordinate of an extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {module:ol/extent/Corner} corner Corner.
|
||||
* @return {module:ol/coordinate~Coordinate} Corner coordinate.
|
||||
* @param {Extent} extent Extent.
|
||||
* @param {import("./extent/Corner.js").default} corner Corner.
|
||||
* @return {import("./coordinate.js").Coordinate} Corner coordinate.
|
||||
*/
|
||||
export function getCorner(extent, corner) {
|
||||
let coordinate;
|
||||
@@ -495,14 +495,14 @@ export function getCorner(extent, corner) {
|
||||
assert(false, 13); // Invalid corner
|
||||
}
|
||||
return (
|
||||
/** @type {!module:ol/coordinate~Coordinate} */ (coordinate)
|
||||
/** @type {!import("./coordinate.js").Coordinate} */ (coordinate)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent1 Extent 1.
|
||||
* @param {module:ol/extent~Extent} extent2 Extent 2.
|
||||
* @param {Extent} extent1 Extent 1.
|
||||
* @param {Extent} extent2 Extent 2.
|
||||
* @return {number} Enlarged area.
|
||||
*/
|
||||
export function getEnlargedArea(extent1, extent2) {
|
||||
@@ -515,12 +515,12 @@ export function getEnlargedArea(extent1, extent2) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/coordinate~Coordinate} center Center.
|
||||
* @param {import("./coordinate.js").Coordinate} center Center.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} rotation Rotation.
|
||||
* @param {module:ol/size~Size} size Size.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @param {import("./size.js").Size} size Size.
|
||||
* @param {Extent=} opt_extent Destination extent.
|
||||
* @return {Extent} Extent.
|
||||
*/
|
||||
export function getForViewAndSize(center, resolution, rotation, size, opt_extent) {
|
||||
const dx = resolution * size[0] / 2;
|
||||
@@ -550,7 +550,7 @@ export function getForViewAndSize(center, resolution, rotation, size, opt_extent
|
||||
|
||||
/**
|
||||
* Get the height of an extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Extent} extent Extent.
|
||||
* @return {number} Height.
|
||||
* @api
|
||||
*/
|
||||
@@ -560,8 +560,8 @@ export function getHeight(extent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent1 Extent 1.
|
||||
* @param {module:ol/extent~Extent} extent2 Extent 2.
|
||||
* @param {Extent} extent1 Extent 1.
|
||||
* @param {Extent} extent2 Extent 2.
|
||||
* @return {number} Intersection area.
|
||||
*/
|
||||
export function getIntersectionArea(extent1, extent2) {
|
||||
@@ -572,10 +572,10 @@ export function getIntersectionArea(extent1, extent2) {
|
||||
|
||||
/**
|
||||
* Get the intersection of two extents.
|
||||
* @param {module:ol/extent~Extent} extent1 Extent 1.
|
||||
* @param {module:ol/extent~Extent} extent2 Extent 2.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Optional extent to populate with intersection.
|
||||
* @return {module:ol/extent~Extent} Intersecting extent.
|
||||
* @param {Extent} extent1 Extent 1.
|
||||
* @param {Extent} extent2 Extent 2.
|
||||
* @param {Extent=} opt_extent Optional extent to populate with intersection.
|
||||
* @return {Extent} Intersecting extent.
|
||||
* @api
|
||||
*/
|
||||
export function getIntersection(extent1, extent2, opt_extent) {
|
||||
@@ -609,7 +609,7 @@ export function getIntersection(extent1, extent2, opt_extent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Extent} extent Extent.
|
||||
* @return {number} Margin.
|
||||
*/
|
||||
export function getMargin(extent) {
|
||||
@@ -619,8 +619,8 @@ export function getMargin(extent) {
|
||||
|
||||
/**
|
||||
* Get the size (width, height) of an extent.
|
||||
* @param {module:ol/extent~Extent} extent The extent.
|
||||
* @return {module:ol/size~Size} The extent size.
|
||||
* @param {Extent} extent The extent.
|
||||
* @return {import("./size.js").Size} The extent size.
|
||||
* @api
|
||||
*/
|
||||
export function getSize(extent) {
|
||||
@@ -630,8 +630,8 @@ export function getSize(extent) {
|
||||
|
||||
/**
|
||||
* Get the top left coordinate of an extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {module:ol/coordinate~Coordinate} Top left coordinate.
|
||||
* @param {Extent} extent Extent.
|
||||
* @return {import("./coordinate.js").Coordinate} Top left coordinate.
|
||||
* @api
|
||||
*/
|
||||
export function getTopLeft(extent) {
|
||||
@@ -641,8 +641,8 @@ export function getTopLeft(extent) {
|
||||
|
||||
/**
|
||||
* Get the top right coordinate of an extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {module:ol/coordinate~Coordinate} Top right coordinate.
|
||||
* @param {Extent} extent Extent.
|
||||
* @return {import("./coordinate.js").Coordinate} Top right coordinate.
|
||||
* @api
|
||||
*/
|
||||
export function getTopRight(extent) {
|
||||
@@ -652,7 +652,7 @@ export function getTopRight(extent) {
|
||||
|
||||
/**
|
||||
* Get the width of an extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Extent} extent Extent.
|
||||
* @return {number} Width.
|
||||
* @api
|
||||
*/
|
||||
@@ -663,8 +663,8 @@ export function getWidth(extent) {
|
||||
|
||||
/**
|
||||
* Determine if one extent intersects another.
|
||||
* @param {module:ol/extent~Extent} extent1 Extent 1.
|
||||
* @param {module:ol/extent~Extent} extent2 Extent.
|
||||
* @param {Extent} extent1 Extent 1.
|
||||
* @param {Extent} extent2 Extent.
|
||||
* @return {boolean} The two extents intersect.
|
||||
* @api
|
||||
*/
|
||||
@@ -678,7 +678,7 @@ export function intersects(extent1, extent2) {
|
||||
|
||||
/**
|
||||
* Determine if an extent is empty.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Extent} extent Extent.
|
||||
* @return {boolean} Is empty.
|
||||
* @api
|
||||
*/
|
||||
@@ -688,9 +688,9 @@ export function isEmpty(extent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @param {Extent} extent Extent.
|
||||
* @param {Extent=} opt_extent Extent.
|
||||
* @return {Extent} Extent.
|
||||
*/
|
||||
export function returnOrUpdate(extent, opt_extent) {
|
||||
if (opt_extent) {
|
||||
@@ -706,7 +706,7 @@ export function returnOrUpdate(extent, opt_extent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Extent} extent Extent.
|
||||
* @param {number} value Value.
|
||||
*/
|
||||
export function scaleFromCenter(extent, value) {
|
||||
@@ -722,9 +722,9 @@ export function scaleFromCenter(extent, value) {
|
||||
/**
|
||||
* Determine if the segment between two coordinates intersects (crosses,
|
||||
* touches, or is contained by) the provided extent.
|
||||
* @param {module:ol/extent~Extent} extent The extent.
|
||||
* @param {module:ol/coordinate~Coordinate} start Segment start coordinate.
|
||||
* @param {module:ol/coordinate~Coordinate} end Segment end coordinate.
|
||||
* @param {Extent} extent The extent.
|
||||
* @param {import("./coordinate.js").Coordinate} start Segment start coordinate.
|
||||
* @param {import("./coordinate.js").Coordinate} end Segment end coordinate.
|
||||
* @return {boolean} The segment intersects the extent.
|
||||
*/
|
||||
export function intersectsSegment(extent, start, end) {
|
||||
@@ -777,11 +777,11 @@ export function intersectsSegment(extent, start, end) {
|
||||
|
||||
/**
|
||||
* Apply a transform function to the extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {module:ol/proj~TransformFunction} transformFn Transform function.
|
||||
* @param {Extent} extent Extent.
|
||||
* @param {import("./proj.js").TransformFunction} transformFn Transform function.
|
||||
* Called with `[minX, minY, maxX, maxY]` extent coordinates.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @param {Extent=} opt_extent Destination extent.
|
||||
* @return {Extent} Extent.
|
||||
* @api
|
||||
*/
|
||||
export function applyTransform(extent, transformFn, opt_extent) {
|
||||
|
||||
@@ -17,8 +17,8 @@ import FormatType from './format/FormatType.js';
|
||||
*
|
||||
* The function is responsible for loading the features and adding them to the
|
||||
* source.
|
||||
* @typedef {function(this:module:ol/source/Vector, module:ol/extent~Extent, number,
|
||||
* module:ol/proj/Projection)} FeatureLoader
|
||||
* @typedef {function(this:import("./source/Vector.js").default, import("./extent.js").Extent, number,
|
||||
* import("./proj/Projection.js").default)} FeatureLoader
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -31,29 +31,29 @@ import FormatType from './format/FormatType.js';
|
||||
* to be loaded, a `{number}` representing the resolution (map units per pixel)
|
||||
* and an {@link module:ol/proj/Projection} for the projection as
|
||||
* arguments and returns a `{string}` representing the URL.
|
||||
* @typedef {function(module:ol/extent~Extent, number, module:ol/proj/Projection): string} FeatureUrlFunction
|
||||
* @typedef {function(import("./extent.js").Extent, number, import("./proj/Projection.js").default): string} FeatureUrlFunction
|
||||
* @api
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @param {string|module:ol/featureloader~FeatureUrlFunction} url Feature URL service.
|
||||
* @param {module:ol/format/Feature} format Feature format.
|
||||
* @param {function(this:module:ol/VectorTile, Array<module:ol/Feature>, module:ol/proj/Projection, module:ol/extent~Extent)|function(this:module:ol/source/Vector, Array<module:ol/Feature>)} success
|
||||
* @param {string|FeatureUrlFunction} url Feature URL service.
|
||||
* @param {import("./format/Feature.js").default} format Feature format.
|
||||
* @param {function(this:import("./VectorTile.js").default, Array<import("./Feature.js").default>, import("./proj/Projection.js").default, import("./extent.js").Extent)|function(this:import("./source/Vector.js").default, Array<import("./Feature.js").default>)} success
|
||||
* Function called with the loaded features and optionally with the data
|
||||
* projection. Called with the vector tile or source as `this`.
|
||||
* @param {function(this:module:ol/VectorTile)|function(this:module:ol/source/Vector)} failure
|
||||
* @param {function(this:import("./VectorTile.js").default)|function(this:import("./source/Vector.js").default)} failure
|
||||
* Function called when loading failed. Called with the vector tile or
|
||||
* source as `this`.
|
||||
* @return {module:ol/featureloader~FeatureLoader} The feature loader.
|
||||
* @return {FeatureLoader} The feature loader.
|
||||
*/
|
||||
export function loadFeaturesXhr(url, format, success, failure) {
|
||||
return (
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("./extent.js").Extent} extent Extent.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {module:ol/proj/Projection} projection Projection.
|
||||
* @this {module:ol/source/Vector|module:ol/VectorTile}
|
||||
* @param {import("./proj/Projection.js").default} projection Projection.
|
||||
* @this {import("./source/Vector.js").default|import("./VectorTile.js").default}
|
||||
*/
|
||||
function(extent, resolution, projection) {
|
||||
const xhr = new XMLHttpRequest();
|
||||
@@ -110,18 +110,18 @@ export function loadFeaturesXhr(url, format, success, failure) {
|
||||
* Create an XHR feature loader for a `url` and `format`. The feature loader
|
||||
* loads features (with XHR), parses the features, and adds them to the
|
||||
* vector source.
|
||||
* @param {string|module:ol/featureloader~FeatureUrlFunction} url Feature URL service.
|
||||
* @param {module:ol/format/Feature} format Feature format.
|
||||
* @return {module:ol/featureloader~FeatureLoader} The feature loader.
|
||||
* @param {string|FeatureUrlFunction} url Feature URL service.
|
||||
* @param {import("./format/Feature.js").default} format Feature format.
|
||||
* @return {FeatureLoader} The feature loader.
|
||||
* @api
|
||||
*/
|
||||
export function xhr(url, format) {
|
||||
return loadFeaturesXhr(url, format,
|
||||
/**
|
||||
* @param {Array<module:ol/Feature>} features The loaded features.
|
||||
* @param {module:ol/proj/Projection} dataProjection Data
|
||||
* @param {Array<import("./Feature.js").default>} features The loaded features.
|
||||
* @param {import("./proj/Projection.js").default} dataProjection Data
|
||||
* projection.
|
||||
* @this {module:ol/source/Vector}
|
||||
* @this {import("./source/Vector.js").default}
|
||||
*/
|
||||
function(features, dataProjection) {
|
||||
this.addFeatures(features);
|
||||
|
||||
@@ -23,7 +23,7 @@ import {get as getProjection} from '../proj.js';
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<module:ol/geom/GeometryType, function(EsriJSONGeometry): module:ol/geom/Geometry>}
|
||||
* @type {Object<import("../geom/GeometryType.js").default, function(EsriJSONGeometry): import("../geom/Geometry.js").default>}
|
||||
*/
|
||||
const GEOMETRY_READERS = {};
|
||||
GEOMETRY_READERS[GeometryType.POINT] = readPointGeometry;
|
||||
@@ -36,7 +36,7 @@ GEOMETRY_READERS[GeometryType.MULTI_POLYGON] = readMultiPolygonGeometry;
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, function(module:ol/geom/Geometry, module:ol/format/Feature~WriteOptions=): (EsriJSONGeometry)>}
|
||||
* @type {Object<string, function(import("../geom/Geometry.js").default, import("./Feature.js").WriteOptions=): (EsriJSONGeometry)>}
|
||||
*/
|
||||
const GEOMETRY_WRITERS = {};
|
||||
GEOMETRY_WRITERS[GeometryType.POINT] = writePointGeometry;
|
||||
@@ -62,7 +62,7 @@ GEOMETRY_WRITERS[GeometryType.MULTI_POLYGON] = writeMultiPolygonGeometry;
|
||||
class EsriJSON extends JSONFeature {
|
||||
|
||||
/**
|
||||
* @param {module:ol/format/EsriJSON~Options=} opt_options Options.
|
||||
* @param {Options=} opt_options Options.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
|
||||
@@ -108,7 +108,7 @@ class EsriJSON extends JSONFeature {
|
||||
const options = opt_options ? opt_options : {};
|
||||
if (esriJSONObject.features) {
|
||||
const esriJSONFeatureCollection = /** @type {EsriJSONFeatureCollection} */ (object);
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
/** @type {Array<import("../Feature.js").default>} */
|
||||
const features = [];
|
||||
const esriJSONFeatures = esriJSONFeatureCollection.features;
|
||||
options.idField = object.objectIdFieldName;
|
||||
@@ -144,8 +144,8 @@ class EsriJSON extends JSONFeature {
|
||||
/**
|
||||
* Encode a geometry as a EsriJSON object.
|
||||
*
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {EsriJSONGeometry} Object.
|
||||
* @override
|
||||
* @api
|
||||
@@ -157,8 +157,8 @@ class EsriJSON extends JSONFeature {
|
||||
/**
|
||||
* Encode a feature as a esriJSON Feature object.
|
||||
*
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {Object} Object.
|
||||
* @override
|
||||
* @api
|
||||
@@ -188,8 +188,8 @@ class EsriJSON extends JSONFeature {
|
||||
/**
|
||||
* Encode an array of features as a EsriJSON object.
|
||||
*
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {Array<import("../Feature.js").default>} features Features.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {Object} EsriJSON Object.
|
||||
* @override
|
||||
* @api
|
||||
@@ -209,14 +209,14 @@ class EsriJSON extends JSONFeature {
|
||||
|
||||
/**
|
||||
* @param {EsriJSONGeometry} object Object.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {module:ol/geom/Geometry} Geometry.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||
*/
|
||||
function readGeometry(object, opt_options) {
|
||||
if (!object) {
|
||||
return null;
|
||||
}
|
||||
/** @type {module:ol/geom/GeometryType} */
|
||||
/** @type {import("../geom/GeometryType.js").default} */
|
||||
let type;
|
||||
if (typeof object.x === 'number' && typeof object.y === 'number') {
|
||||
type = GeometryType.POINT;
|
||||
@@ -242,7 +242,7 @@ function readGeometry(object, opt_options) {
|
||||
}
|
||||
const geometryReader = GEOMETRY_READERS[type];
|
||||
return (
|
||||
/** @type {module:ol/geom/Geometry} */ (transformWithOptions(geometryReader(object), false, opt_options))
|
||||
/** @type {import("../geom/Geometry.js").default} */ (transformWithOptions(geometryReader(object), false, opt_options))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ function readGeometry(object, opt_options) {
|
||||
* array. It is used for checking for holes.
|
||||
* Logic inspired by: https://github.com/Esri/terraformer-arcgis-parser
|
||||
* @param {Array<!Array<!Array<number>>>} rings Rings.
|
||||
* @param {module:ol/geom/GeometryLayout} layout Geometry layout.
|
||||
* @param {import("../geom/GeometryLayout.js").default} layout Geometry layout.
|
||||
* @return {Array<!Array<!Array<number>>>} Transformed rings.
|
||||
*/
|
||||
function convertRings(rings, layout) {
|
||||
@@ -302,7 +302,7 @@ function convertRings(rings, layout) {
|
||||
|
||||
/**
|
||||
* @param {EsriJSONGeometry} object Object.
|
||||
* @return {module:ol/geom/Geometry} Point.
|
||||
* @return {import("../geom/Geometry.js").default} Point.
|
||||
*/
|
||||
function readPointGeometry(object) {
|
||||
let point;
|
||||
@@ -324,7 +324,7 @@ function readPointGeometry(object) {
|
||||
|
||||
/**
|
||||
* @param {EsriJSONGeometry} object Object.
|
||||
* @return {module:ol/geom/Geometry} LineString.
|
||||
* @return {import("../geom/Geometry.js").default} LineString.
|
||||
*/
|
||||
function readLineStringGeometry(object) {
|
||||
const layout = getGeometryLayout(object);
|
||||
@@ -334,7 +334,7 @@ function readLineStringGeometry(object) {
|
||||
|
||||
/**
|
||||
* @param {EsriJSONGeometry} object Object.
|
||||
* @return {module:ol/geom/Geometry} MultiLineString.
|
||||
* @return {import("../geom/Geometry.js").default} MultiLineString.
|
||||
*/
|
||||
function readMultiLineStringGeometry(object) {
|
||||
const layout = getGeometryLayout(object);
|
||||
@@ -344,7 +344,7 @@ function readMultiLineStringGeometry(object) {
|
||||
|
||||
/**
|
||||
* @param {EsriJSONGeometry} object Object.
|
||||
* @return {module:ol/geom/GeometryLayout} The geometry layout to use.
|
||||
* @return {import("../geom/GeometryLayout.js").default} The geometry layout to use.
|
||||
*/
|
||||
function getGeometryLayout(object) {
|
||||
let layout = GeometryLayout.XY;
|
||||
@@ -361,7 +361,7 @@ function getGeometryLayout(object) {
|
||||
|
||||
/**
|
||||
* @param {EsriJSONGeometry} object Object.
|
||||
* @return {module:ol/geom/Geometry} MultiPoint.
|
||||
* @return {import("../geom/Geometry.js").default} MultiPoint.
|
||||
*/
|
||||
function readMultiPointGeometry(object) {
|
||||
const layout = getGeometryLayout(object);
|
||||
@@ -371,7 +371,7 @@ function readMultiPointGeometry(object) {
|
||||
|
||||
/**
|
||||
* @param {EsriJSONGeometry} object Object.
|
||||
* @return {module:ol/geom/Geometry} MultiPolygon.
|
||||
* @return {import("../geom/Geometry.js").default} MultiPolygon.
|
||||
*/
|
||||
function readMultiPolygonGeometry(object) {
|
||||
const layout = getGeometryLayout(object);
|
||||
@@ -383,7 +383,7 @@ function readMultiPolygonGeometry(object) {
|
||||
|
||||
/**
|
||||
* @param {EsriJSONGeometry} object Object.
|
||||
* @return {module:ol/geom/Geometry} Polygon.
|
||||
* @return {import("../geom/Geometry.js").default} Polygon.
|
||||
*/
|
||||
function readPolygonGeometry(object) {
|
||||
const layout = getGeometryLayout(object);
|
||||
@@ -392,14 +392,14 @@ function readPolygonGeometry(object) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {EsriJSONGeometry} EsriJSON geometry.
|
||||
*/
|
||||
function writePointGeometry(geometry, opt_options) {
|
||||
const coordinates = /** @type {module:ol/geom/Point} */ (geometry).getCoordinates();
|
||||
const coordinates = /** @type {import("../geom/Point.js").default} */ (geometry).getCoordinates();
|
||||
let esriJSON;
|
||||
const layout = /** @type {module:ol/geom/Point} */ (geometry).getLayout();
|
||||
const layout = /** @type {import("../geom/Point.js").default} */ (geometry).getLayout();
|
||||
if (layout === GeometryLayout.XYZ) {
|
||||
esriJSON = /** @type {EsriJSONPoint} */ ({
|
||||
x: coordinates[0],
|
||||
@@ -432,7 +432,7 @@ function writePointGeometry(geometry, opt_options) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/SimpleGeometry} geometry Geometry.
|
||||
* @param {import("../geom/SimpleGeometry.js").default} geometry Geometry.
|
||||
* @return {Object} Object with boolean hasZ and hasM keys.
|
||||
*/
|
||||
function getHasZM(geometry) {
|
||||
@@ -447,18 +447,18 @@ function getHasZM(geometry) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {EsriJSONPolyline} EsriJSON geometry.
|
||||
*/
|
||||
function writeLineStringGeometry(geometry, opt_options) {
|
||||
const hasZM = getHasZM(/** @type {module:ol/geom/LineString} */(geometry));
|
||||
const hasZM = getHasZM(/** @type {import("../geom/LineString.js").default} */(geometry));
|
||||
return (
|
||||
/** @type {EsriJSONPolyline} */ {
|
||||
hasZ: hasZM.hasZ,
|
||||
hasM: hasZM.hasM,
|
||||
paths: [
|
||||
/** @type {module:ol/geom/LineString} */ (geometry).getCoordinates()
|
||||
/** @type {import("../geom/LineString.js").default} */ (geometry).getCoordinates()
|
||||
]
|
||||
}
|
||||
);
|
||||
@@ -466,65 +466,65 @@ function writeLineStringGeometry(geometry, opt_options) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {EsriJSONPolygon} EsriJSON geometry.
|
||||
*/
|
||||
function writePolygonGeometry(geometry, opt_options) {
|
||||
// Esri geometries use the left-hand rule
|
||||
const hasZM = getHasZM(/** @type {module:ol/geom/Polygon} */(geometry));
|
||||
const hasZM = getHasZM(/** @type {import("../geom/Polygon.js").default} */(geometry));
|
||||
return (
|
||||
/** @type {EsriJSONPolygon} */ {
|
||||
hasZ: hasZM.hasZ,
|
||||
hasM: hasZM.hasM,
|
||||
rings: /** @type {module:ol/geom/Polygon} */ (geometry).getCoordinates(false)
|
||||
rings: /** @type {import("../geom/Polygon.js").default} */ (geometry).getCoordinates(false)
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {EsriJSONPolyline} EsriJSON geometry.
|
||||
*/
|
||||
function writeMultiLineStringGeometry(geometry, opt_options) {
|
||||
const hasZM = getHasZM(/** @type {module:ol/geom/MultiLineString} */(geometry));
|
||||
const hasZM = getHasZM(/** @type {import("../geom/MultiLineString.js").default} */(geometry));
|
||||
return (
|
||||
/** @type {EsriJSONPolyline} */ {
|
||||
hasZ: hasZM.hasZ,
|
||||
hasM: hasZM.hasM,
|
||||
paths: /** @type {module:ol/geom/MultiLineString} */ (geometry).getCoordinates()
|
||||
paths: /** @type {import("../geom/MultiLineString.js").default} */ (geometry).getCoordinates()
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {EsriJSONMultipoint} EsriJSON geometry.
|
||||
*/
|
||||
function writeMultiPointGeometry(geometry, opt_options) {
|
||||
const hasZM = getHasZM(/** @type {module:ol/geom/MultiPoint} */(geometry));
|
||||
const hasZM = getHasZM(/** @type {import("../geom/MultiPoint.js").default} */(geometry));
|
||||
return (
|
||||
/** @type {EsriJSONMultipoint} */ {
|
||||
hasZ: hasZM.hasZ,
|
||||
hasM: hasZM.hasM,
|
||||
points: /** @type {module:ol/geom/MultiPoint} */ (geometry).getCoordinates()
|
||||
points: /** @type {import("../geom/MultiPoint.js").default} */ (geometry).getCoordinates()
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {EsriJSONPolygon} EsriJSON geometry.
|
||||
*/
|
||||
function writeMultiPolygonGeometry(geometry, opt_options) {
|
||||
const hasZM = getHasZM(/** @type {module:ol/geom/MultiPolygon} */(geometry));
|
||||
const coordinates = /** @type {module:ol/geom/MultiPolygon} */ (geometry).getCoordinates(false);
|
||||
const hasZM = getHasZM(/** @type {import("../geom/MultiPolygon.js").default} */(geometry));
|
||||
const coordinates = /** @type {import("../geom/MultiPolygon.js").default} */ (geometry).getCoordinates(false);
|
||||
const output = [];
|
||||
for (let i = 0; i < coordinates.length; i++) {
|
||||
for (let x = coordinates[i].length - 1; x >= 0; x--) {
|
||||
@@ -540,13 +540,13 @@ function writeMultiPolygonGeometry(geometry, opt_options) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {EsriJSONGeometry} EsriJSON geometry.
|
||||
*/
|
||||
function writeGeometry(geometry, opt_options) {
|
||||
const geometryWriter = GEOMETRY_WRITERS[geometry.getType()];
|
||||
return geometryWriter(/** @type {module:ol/geom/Geometry} */(
|
||||
return geometryWriter(/** @type {import("../geom/Geometry.js").default} */(
|
||||
transformWithOptions(geometry, true, opt_options)), opt_options);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
|
||||
|
||||
/**
|
||||
* @typedef {Object} ReadOptions
|
||||
* @property {module:ol/proj~ProjectionLike} [dataProjection] Projection of the data we are reading.
|
||||
* @property {import("../proj.js").ProjectionLike} [dataProjection] Projection of the data we are reading.
|
||||
* If not provided, the projection will be derived from the data (where possible) or
|
||||
* the `dataProjection` of the format is assigned (where set). If the projection
|
||||
* can not be derived from the data and if no `dataProjection` is set for a format,
|
||||
* the features will not be reprojected.
|
||||
* @property {module:ol/extent~Extent} [extent] Tile extent of the tile being read. This is only used and
|
||||
* @property {import("../extent.js").Extent} [extent] Tile extent of the tile being read. This is only used and
|
||||
* required for {@link module:ol/format/MVT}.
|
||||
* @property {module:ol/proj~ProjectionLike} [featureProjection] Projection of the feature geometries
|
||||
* @property {import("../proj.js").ProjectionLike} [featureProjection] Projection of the feature geometries
|
||||
* created by the format reader. If not provided, features will be returned in the
|
||||
* `dataProjection`.
|
||||
*/
|
||||
@@ -23,11 +23,11 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
|
||||
|
||||
/**
|
||||
* @typedef {Object} WriteOptions
|
||||
* @property {module:ol/proj~ProjectionLike} [dataProjection] Projection of the data we are writing.
|
||||
* @property {import("../proj.js").ProjectionLike} [dataProjection] Projection of the data we are writing.
|
||||
* If not provided, the `dataProjection` of the format is assigned (where set).
|
||||
* If no `dataProjection` is set for a format, the features will be returned
|
||||
* in the `featureProjection`.
|
||||
* @property {module:ol/proj~ProjectionLike} [featureProjection] Projection of the feature geometries
|
||||
* @property {import("../proj.js").ProjectionLike} [featureProjection] Projection of the feature geometries
|
||||
* that will be serialized by the format writer. If not provided, geometries are assumed
|
||||
* to be in the `dataProjection` if that is set; in other words, they are not transformed.
|
||||
* @property {boolean} [rightHanded] When writing geometries, follow the right-hand
|
||||
@@ -52,7 +52,7 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
|
||||
* Abstract base class; normally only used for creating subclasses and not
|
||||
* instantiated in apps.
|
||||
* Base class for feature formats.
|
||||
* {module:ol/format/Feature~FeatureFormat} subclasses provide the ability to decode and encode
|
||||
* {FeatureFormat} subclasses provide the ability to decode and encode
|
||||
* {@link module:ol/Feature~Feature} objects from a variety of commonly used geospatial
|
||||
* file formats. See the documentation for each format for more details.
|
||||
*
|
||||
@@ -64,13 +64,13 @@ class FeatureFormat {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {module:ol/proj/Projection}
|
||||
* @type {import("../proj/Projection.js").default}
|
||||
*/
|
||||
this.dataProjection = null;
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {module:ol/proj/Projection}
|
||||
* @type {import("../proj/Projection.js").default}
|
||||
*/
|
||||
this.defaultFeatureProjection = null;
|
||||
|
||||
@@ -79,8 +79,8 @@ class FeatureFormat {
|
||||
/**
|
||||
* Adds the data projection to the read options.
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||
* @return {module:ol/format/Feature~ReadOptions|undefined} Options.
|
||||
* @param {ReadOptions=} opt_options Options.
|
||||
* @return {ReadOptions|undefined} Options.
|
||||
* @protected
|
||||
*/
|
||||
getReadOptions(source, opt_options) {
|
||||
@@ -98,10 +98,10 @@ class FeatureFormat {
|
||||
/**
|
||||
* Sets the `dataProjection` on the options, if no `dataProjection`
|
||||
* is set.
|
||||
* @param {module:ol/format/Feature~WriteOptions|module:ol/format/Feature~ReadOptions|undefined} options
|
||||
* @param {WriteOptions|ReadOptions|undefined} options
|
||||
* Options.
|
||||
* @protected
|
||||
* @return {module:ol/format/Feature~WriteOptions|module:ol/format/Feature~ReadOptions|undefined}
|
||||
* @return {WriteOptions|ReadOptions|undefined}
|
||||
* Updated options.
|
||||
*/
|
||||
adaptOptions(options) {
|
||||
@@ -113,7 +113,7 @@ class FeatureFormat {
|
||||
|
||||
/**
|
||||
* Get the extent from the source of the last {@link readFeatures} call.
|
||||
* @return {module:ol/extent~Extent} Tile extent.
|
||||
* @return {import("../extent.js").Extent} Tile extent.
|
||||
*/
|
||||
getLastExtent() {
|
||||
return null;
|
||||
@@ -121,7 +121,7 @@ class FeatureFormat {
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return {module:ol/format/FormatType} Format.
|
||||
* @return {import("./FormatType.js").default} Format.
|
||||
*/
|
||||
getType() {}
|
||||
|
||||
@@ -130,8 +130,8 @@ class FeatureFormat {
|
||||
*
|
||||
* @abstract
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {module:ol/Feature} Feature.
|
||||
* @param {ReadOptions=} opt_options Read options.
|
||||
* @return {import("../Feature.js").default} Feature.
|
||||
*/
|
||||
readFeature(source, opt_options) {}
|
||||
|
||||
@@ -140,8 +140,8 @@ class FeatureFormat {
|
||||
*
|
||||
* @abstract
|
||||
* @param {Document|Node|ArrayBuffer|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @param {ReadOptions=} opt_options Read options.
|
||||
* @return {Array<import("../Feature.js").default>} Features.
|
||||
*/
|
||||
readFeatures(source, opt_options) {}
|
||||
|
||||
@@ -150,8 +150,8 @@ class FeatureFormat {
|
||||
*
|
||||
* @abstract
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {module:ol/geom/Geometry} Geometry.
|
||||
* @param {ReadOptions=} opt_options Read options.
|
||||
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||
*/
|
||||
readGeometry(source, opt_options) {}
|
||||
|
||||
@@ -160,7 +160,7 @@ class FeatureFormat {
|
||||
*
|
||||
* @abstract
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @return {module:ol/proj/Projection} Projection.
|
||||
* @return {import("../proj/Projection.js").default} Projection.
|
||||
*/
|
||||
readProjection(source) {}
|
||||
|
||||
@@ -168,8 +168,8 @@ class FeatureFormat {
|
||||
* Encode a feature in this format.
|
||||
*
|
||||
* @abstract
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {WriteOptions=} opt_options Write options.
|
||||
* @return {string} Result.
|
||||
*/
|
||||
writeFeature(feature, opt_options) {}
|
||||
@@ -178,8 +178,8 @@ class FeatureFormat {
|
||||
* Encode an array of features in this format.
|
||||
*
|
||||
* @abstract
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {Array<import("../Feature.js").default>} features Features.
|
||||
* @param {WriteOptions=} opt_options Write options.
|
||||
* @return {string} Result.
|
||||
*/
|
||||
writeFeatures(features, opt_options) {}
|
||||
@@ -188,8 +188,8 @@ class FeatureFormat {
|
||||
* Write a single geometry in this format.
|
||||
*
|
||||
* @abstract
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {WriteOptions=} opt_options Write options.
|
||||
* @return {string} Result.
|
||||
*/
|
||||
writeGeometry(geometry, opt_options) {}
|
||||
@@ -198,11 +198,11 @@ class FeatureFormat {
|
||||
export default FeatureFormat;
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry|module:ol/extent~Extent} geometry Geometry.
|
||||
* @param {import("../geom/Geometry.js").default|import("../extent.js").Extent} geometry Geometry.
|
||||
* @param {boolean} write Set to true for writing, false for reading.
|
||||
* @param {module:ol/format/Feature~WriteOptions|module:ol/format/Feature~ReadOptions|undefined} opt_options
|
||||
* @param {WriteOptions|ReadOptions|undefined} opt_options
|
||||
* Options.
|
||||
* @return {module:ol/geom/Geometry|module:ol/extent~Extent} Transformed geometry.
|
||||
* @return {import("../geom/Geometry.js").default|import("../extent.js").Extent} Transformed geometry.
|
||||
*/
|
||||
export function transformWithOptions(geometry, write, opt_options) {
|
||||
const featureProjection = opt_options ?
|
||||
@@ -210,7 +210,7 @@ export function transformWithOptions(geometry, write, opt_options) {
|
||||
const dataProjection = opt_options ?
|
||||
getProjection(opt_options.dataProjection) : null;
|
||||
/**
|
||||
* @type {module:ol/geom/Geometry|module:ol/extent~Extent}
|
||||
* @type {import("../geom/Geometry.js").default|import("../extent.js").Extent}
|
||||
*/
|
||||
let transformed;
|
||||
if (featureProjection && dataProjection &&
|
||||
|
||||
@@ -9,7 +9,7 @@ import GML3 from '../format/GML3.js';
|
||||
* version 3.1.1.
|
||||
* Currently only supports GML 3.1.1 Simple Features profile.
|
||||
*
|
||||
* @param {module:ol/format/GMLBase~Options=} opt_options
|
||||
* @param {import("./GMLBase.js").Options=} opt_options
|
||||
* Optional configuration object.
|
||||
* @api
|
||||
*/
|
||||
@@ -20,8 +20,8 @@ const GML = GML3;
|
||||
* Encode an array of features in GML 3.1.1 Simple Features.
|
||||
*
|
||||
* @function
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @param {Array<import("../Feature.js").default>} features Features.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||
* @return {string} Result.
|
||||
* @api
|
||||
*/
|
||||
@@ -32,8 +32,8 @@ GML.prototype.writeFeatures;
|
||||
* Encode an array of features in the GML 3.1.1 format as an XML node.
|
||||
*
|
||||
* @function
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @param {Array<import("../Feature.js").default>} features Features.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||
* @return {Node} Node.
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -41,10 +41,10 @@ const MULTIGEOMETRY_TO_MEMBER_NODENAME = {
|
||||
class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {module:ol/format/GMLBase~Options=} opt_options Optional configuration object.
|
||||
* @param {import("./GMLBase.js").Options=} opt_options Optional configuration object.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
const options = /** @type {module:ol/format/GMLBase~Options} */
|
||||
const options = /** @type {import("./GMLBase.js").Options} */
|
||||
(opt_options ? opt_options : {});
|
||||
|
||||
super(options);
|
||||
@@ -69,7 +69,7 @@ class GML2 extends GMLBase {
|
||||
*/
|
||||
readFlatCoordinates_(node, objectStack) {
|
||||
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
||||
const context = /** @type {module:ol/xml~NodeStackItem} */ (objectStack[0]);
|
||||
const context = /** @type {import("../xml.js").NodeStackItem} */ (objectStack[0]);
|
||||
const containerSrs = context['srsName'];
|
||||
let axisOrientation = 'enu';
|
||||
if (containerSrs) {
|
||||
@@ -98,7 +98,7 @@ class GML2 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/extent~Extent|undefined} Envelope.
|
||||
* @return {import("../extent.js").Extent|undefined} Envelope.
|
||||
*/
|
||||
readBox_(node, objectStack) {
|
||||
/** @type {Array<number>} */
|
||||
@@ -156,7 +156,7 @@ class GML2 extends GMLBase {
|
||||
const multiCurve = context['multiCurve'];
|
||||
let nodeName;
|
||||
if (!Array.isArray(value)) {
|
||||
nodeName = /** @type {module:ol/geom/Geometry} */ (value).getType();
|
||||
nodeName = /** @type {import("../geom/Geometry.js").default} */ (value).getType();
|
||||
if (nodeName === 'MultiPolygon' && multiSurface === true) {
|
||||
nodeName = 'MultiSurface';
|
||||
} else if (nodeName === 'Polygon' && surface === true) {
|
||||
@@ -173,7 +173,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
writeFeatureElement(node, feature, objectStack) {
|
||||
@@ -210,7 +210,7 @@ class GML2 extends GMLBase {
|
||||
}
|
||||
const item = assign({}, context);
|
||||
item.node = node;
|
||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
||||
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
|
||||
(item), context.serializers,
|
||||
makeSimpleNodeFactory(undefined, featureNS),
|
||||
values,
|
||||
@@ -219,7 +219,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/geom/LineString} geometry LineString geometry.
|
||||
* @param {import("../geom/LineString.js").default} geometry LineString geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -244,7 +244,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||
* @param {import("../geom/LineString.js").default} line LineString geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -258,7 +258,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/geom/MultiLineString} geometry MultiLineString geometry.
|
||||
* @param {import("../geom/MultiLineString.js").default} geometry MultiLineString geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -279,11 +279,11 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Geometry|module:ol/extent~Extent} geometry Geometry.
|
||||
* @param {import("../geom/Geometry.js").default|import("../extent.js").Extent} geometry Geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
writeGeometryElement(node, geometry, objectStack) {
|
||||
const context = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[objectStack.length - 1]);
|
||||
const context = /** @type {import("./Feature.js").WriteOptions} */ (objectStack[objectStack.length - 1]);
|
||||
const item = assign({}, context);
|
||||
item.node = node;
|
||||
let value;
|
||||
@@ -295,9 +295,9 @@ class GML2 extends GMLBase {
|
||||
value = geometry;
|
||||
}
|
||||
} else {
|
||||
value = transformWithOptions(/** @type {module:ol/geom/Geometry} */ (geometry), true, context);
|
||||
value = transformWithOptions(/** @type {import("../geom/Geometry.js").default} */ (geometry), true, context);
|
||||
}
|
||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
||||
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
|
||||
(item), this.GEOMETRY_SERIALIZERS_,
|
||||
this.GEOMETRY_NODE_FACTORY_, [value],
|
||||
objectStack, undefined, this);
|
||||
@@ -319,7 +319,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString|module:ol/geom/LinearRing} value Geometry.
|
||||
* @param {import("../geom/LineString.js").default|import("../geom/LinearRing.js").default} value Geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -340,7 +340,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||
* @param {import("../geom/LineString.js").default} line LineString geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -352,7 +352,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/geom/Polygon} geometry Polygon geometry.
|
||||
* @param {import("../geom/Polygon.js").default} geometry Polygon geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -398,7 +398,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||
* @param {import("../geom/Polygon.js").default} polygon Polygon geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -410,7 +410,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LinearRing} ring LinearRing geometry.
|
||||
* @param {import("../geom/LinearRing.js").default} ring LinearRing geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -446,7 +446,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/geom/Point} geometry Point geometry.
|
||||
* @param {import("../geom/Point.js").default} geometry Point geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -466,7 +466,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/geom/MultiPoint} geometry MultiPoint geometry.
|
||||
* @param {import("../geom/MultiPoint.js").default} geometry MultiPoint geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -486,7 +486,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Point} point Point geometry.
|
||||
* @param {import("../geom/Point.js").default} point Point geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -498,7 +498,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/geom/LinearRing} geometry LinearRing geometry.
|
||||
* @param {import("../geom/LinearRing.js").default} geometry LinearRing geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -515,7 +515,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/geom/MultiPolygon} geometry MultiPolygon geometry.
|
||||
* @param {import("../geom/MultiPolygon.js").default} geometry MultiPolygon geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -536,7 +536,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||
* @param {import("../geom/Polygon.js").default} polygon Polygon geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -551,7 +551,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("../extent.js").Extent} extent Extent.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -563,7 +563,7 @@ class GML2 extends GMLBase {
|
||||
}
|
||||
const keys = ['lowerCorner', 'upperCorner'];
|
||||
const values = [extent[0] + ' ' + extent[1], extent[2] + ' ' + extent[3]];
|
||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
||||
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
|
||||
({node: node}), this.ENVELOPE_SERIALIZERS_,
|
||||
OBJECT_PROPERTY_NODE_FACTORY,
|
||||
values,
|
||||
@@ -587,7 +587,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
@@ -598,7 +598,7 @@ GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
@@ -610,7 +610,7 @@ GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.BOX_PARSERS_ = {
|
||||
@@ -622,7 +622,7 @@ GML2.prototype.BOX_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.GEOMETRY_PARSERS_ = {
|
||||
@@ -645,7 +645,7 @@ GML2.prototype.GEOMETRY_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.GEOMETRY_SERIALIZERS_ = {
|
||||
@@ -677,7 +677,7 @@ GML2.prototype.GEOMETRY_SERIALIZERS_ = {
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
@@ -690,7 +690,7 @@ GML2.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.RING_SERIALIZERS_ = {
|
||||
@@ -701,7 +701,7 @@ GML2.prototype.RING_SERIALIZERS_ = {
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.POINTMEMBER_SERIALIZERS_ = {
|
||||
@@ -713,7 +713,7 @@ GML2.prototype.POINTMEMBER_SERIALIZERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
@@ -726,7 +726,7 @@ GML2.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.ENVELOPE_SERIALIZERS_ = {
|
||||
|
||||
@@ -52,10 +52,10 @@ const MULTIGEOMETRY_TO_MEMBER_NODENAME = {
|
||||
class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {module:ol/format/GMLBase~Options=} opt_options Optional configuration object.
|
||||
* @param {import("./GMLBase.js").Options=} opt_options Optional configuration object.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
const options = /** @type {module:ol/format/GMLBase~Options} */
|
||||
const options = /** @type {import("./GMLBase.js").Options} */
|
||||
(opt_options ? opt_options : {});
|
||||
|
||||
super(options);
|
||||
@@ -105,10 +105,10 @@ class GML3 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
||||
* @return {import("../geom/MultiLineString.js").default|undefined} MultiLineString.
|
||||
*/
|
||||
readMultiCurve_(node, objectStack) {
|
||||
/** @type {Array<module:ol/geom/LineString>} */
|
||||
/** @type {Array<import("../geom/LineString.js").default>} */
|
||||
const lineStrings = pushParseAndPop([],
|
||||
this.MULTICURVE_PARSERS_, node, objectStack, this);
|
||||
if (lineStrings) {
|
||||
@@ -123,10 +123,10 @@ class GML3 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/geom/MultiPolygon|undefined} MultiPolygon.
|
||||
* @return {import("../geom/MultiPolygon.js").default|undefined} MultiPolygon.
|
||||
*/
|
||||
readMultiSurface_(node, objectStack) {
|
||||
/** @type {Array<module:ol/geom/Polygon>} */
|
||||
/** @type {Array<import("../geom/Polygon.js").default>} */
|
||||
const polygons = pushParseAndPop([],
|
||||
this.MULTISURFACE_PARSERS_, node, objectStack, this);
|
||||
if (polygons) {
|
||||
@@ -234,7 +234,7 @@ class GML3 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
||||
* @return {import("../geom/Polygon.js").default|undefined} Polygon.
|
||||
*/
|
||||
readSurface_(node, objectStack) {
|
||||
/** @type {Array<Array<number>>} */
|
||||
@@ -258,7 +258,7 @@ class GML3 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/geom/LineString|undefined} LineString.
|
||||
* @return {import("../geom/LineString.js").default|undefined} LineString.
|
||||
*/
|
||||
readCurve_(node, objectStack) {
|
||||
/** @type {Array<number>} */
|
||||
@@ -276,7 +276,7 @@ class GML3 extends GMLBase {
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/extent~Extent|undefined} Envelope.
|
||||
* @return {import("../extent.js").Extent|undefined} Envelope.
|
||||
*/
|
||||
readEnvelope_(node, objectStack) {
|
||||
/** @type {Array<number>} */
|
||||
@@ -380,7 +380,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/geom/Point} value Point geometry.
|
||||
* @param {import("../geom/Point.js").default} value Point geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -436,7 +436,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/geom/LineString|module:ol/geom/LinearRing} value Geometry.
|
||||
* @param {import("../geom/LineString.js").default|import("../geom/LinearRing.js").default} value Geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -460,7 +460,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/geom/Point} geometry Point geometry.
|
||||
* @param {import("../geom/Point.js").default} geometry Point geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -477,7 +477,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("../extent.js").Extent} extent Extent.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
writeEnvelope(node, extent, objectStack) {
|
||||
@@ -488,7 +488,7 @@ class GML3 extends GMLBase {
|
||||
}
|
||||
const keys = ['lowerCorner', 'upperCorner'];
|
||||
const values = [extent[0] + ' ' + extent[1], extent[2] + ' ' + extent[3]];
|
||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
||||
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
|
||||
({node: node}), this.ENVELOPE_SERIALIZERS_,
|
||||
OBJECT_PROPERTY_NODE_FACTORY,
|
||||
values,
|
||||
@@ -497,7 +497,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/geom/LinearRing} geometry LinearRing geometry.
|
||||
* @param {import("../geom/LinearRing.js").default} geometry LinearRing geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -532,7 +532,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/geom/Polygon} geometry Polygon geometry.
|
||||
* @param {import("../geom/Polygon.js").default} geometry Polygon geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -560,7 +560,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/geom/LineString} geometry LineString geometry.
|
||||
* @param {import("../geom/LineString.js").default} geometry LineString geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -585,7 +585,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/geom/MultiPolygon} geometry MultiPolygon geometry.
|
||||
* @param {import("../geom/MultiPolygon.js").default} geometry MultiPolygon geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -606,7 +606,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/geom/MultiPoint} geometry MultiPoint geometry.
|
||||
* @param {import("../geom/MultiPoint.js").default} geometry MultiPoint geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -626,7 +626,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/geom/MultiLineString} geometry MultiLineString geometry.
|
||||
* @param {import("../geom/MultiLineString.js").default} geometry MultiLineString geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -647,7 +647,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LinearRing} ring LinearRing geometry.
|
||||
* @param {import("../geom/LinearRing.js").default} ring LinearRing geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -659,7 +659,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||
* @param {import("../geom/Polygon.js").default} polygon Polygon geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -674,7 +674,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Point} point Point geometry.
|
||||
* @param {import("../geom/Point.js").default} point Point geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -686,7 +686,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||
* @param {import("../geom/LineString.js").default} line LineString geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -700,7 +700,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||
* @param {import("../geom/Polygon.js").default} polygon Polygon geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -712,7 +712,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||
* @param {import("../geom/LineString.js").default} line LineString geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -725,11 +725,11 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Geometry|module:ol/extent~Extent} geometry Geometry.
|
||||
* @param {import("../geom/Geometry.js").default|import("../extent.js").Extent} geometry Geometry.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
writeGeometryElement(node, geometry, objectStack) {
|
||||
const context = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[objectStack.length - 1]);
|
||||
const context = /** @type {import("./Feature.js").WriteOptions} */ (objectStack[objectStack.length - 1]);
|
||||
const item = assign({}, context);
|
||||
item.node = node;
|
||||
let value;
|
||||
@@ -741,9 +741,9 @@ class GML3 extends GMLBase {
|
||||
value = geometry;
|
||||
}
|
||||
} else {
|
||||
value = transformWithOptions(/** @type {module:ol/geom/Geometry} */ (geometry), true, context);
|
||||
value = transformWithOptions(/** @type {import("../geom/Geometry.js").default} */ (geometry), true, context);
|
||||
}
|
||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
||||
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
|
||||
(item), this.GEOMETRY_SERIALIZERS_,
|
||||
this.GEOMETRY_NODE_FACTORY_, [value],
|
||||
objectStack, undefined, this);
|
||||
@@ -751,7 +751,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
writeFeatureElement(node, feature, objectStack) {
|
||||
@@ -788,7 +788,7 @@ class GML3 extends GMLBase {
|
||||
}
|
||||
const item = assign({}, context);
|
||||
item.node = node;
|
||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
||||
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
|
||||
(item), context.serializers,
|
||||
makeSimpleNodeFactory(undefined, featureNS),
|
||||
values,
|
||||
@@ -797,7 +797,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {Array<import("../Feature.js").default>} features Features.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
@@ -811,7 +811,7 @@ class GML3 extends GMLBase {
|
||||
this.writeFeatureElement, this);
|
||||
const item = assign({}, context);
|
||||
item.node = node;
|
||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
||||
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
|
||||
(item),
|
||||
serializers,
|
||||
makeSimpleNodeFactory(featureType, featureNS), features,
|
||||
@@ -848,7 +848,7 @@ class GML3 extends GMLBase {
|
||||
const multiCurve = context['multiCurve'];
|
||||
let nodeName;
|
||||
if (!Array.isArray(value)) {
|
||||
nodeName = /** @type {module:ol/geom/Geometry} */ (value).getType();
|
||||
nodeName = /** @type {import("../geom/Geometry.js").default} */ (value).getType();
|
||||
if (nodeName === 'MultiPolygon' && multiSurface === true) {
|
||||
nodeName = 'MultiSurface';
|
||||
} else if (nodeName === 'Polygon' && surface === true) {
|
||||
@@ -868,8 +868,8 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* Encode a geometry in GML 3.1.1 Simple Features.
|
||||
*
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||
* @return {Node} Node.
|
||||
* @override
|
||||
* @api
|
||||
@@ -890,8 +890,8 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* Encode an array of features in the GML 3.1.1 format as an XML node.
|
||||
*
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @param {Array<import("../Feature.js").default>} features Features.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||
* @return {Element} Node.
|
||||
* @override
|
||||
* @api
|
||||
@@ -920,7 +920,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
@@ -933,7 +933,7 @@ GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
@@ -946,7 +946,7 @@ GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.GEOMETRY_PARSERS_ = {
|
||||
@@ -976,7 +976,7 @@ GML3.prototype.GEOMETRY_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.MULTICURVE_PARSERS_ = {
|
||||
@@ -991,7 +991,7 @@ GML3.prototype.MULTICURVE_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.MULTISURFACE_PARSERS_ = {
|
||||
@@ -1006,7 +1006,7 @@ GML3.prototype.MULTISURFACE_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.CURVEMEMBER_PARSERS_ = {
|
||||
@@ -1020,7 +1020,7 @@ GML3.prototype.CURVEMEMBER_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.SURFACEMEMBER_PARSERS_ = {
|
||||
@@ -1033,7 +1033,7 @@ GML3.prototype.SURFACEMEMBER_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.SURFACE_PARSERS_ = {
|
||||
@@ -1045,7 +1045,7 @@ GML3.prototype.SURFACE_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.CURVE_PARSERS_ = {
|
||||
@@ -1057,7 +1057,7 @@ GML3.prototype.CURVE_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.ENVELOPE_PARSERS_ = {
|
||||
@@ -1072,7 +1072,7 @@ GML3.prototype.ENVELOPE_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.PATCHES_PARSERS_ = {
|
||||
@@ -1085,7 +1085,7 @@ GML3.prototype.PATCHES_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.SEGMENTS_PARSERS_ = {
|
||||
@@ -1100,8 +1100,8 @@ GML3.prototype.SEGMENTS_PARSERS_ = {
|
||||
* Encode an array of features in GML 3.1.1 Simple Features.
|
||||
*
|
||||
* @function
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @param {Array<import("../Feature.js").default>} features Features.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||
* @return {string} Result.
|
||||
* @api
|
||||
*/
|
||||
@@ -1109,7 +1109,7 @@ GML3.prototype.writeFeatures;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.RING_SERIALIZERS_ = {
|
||||
@@ -1121,7 +1121,7 @@ GML3.prototype.RING_SERIALIZERS_ = {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.ENVELOPE_SERIALIZERS_ = {
|
||||
@@ -1133,7 +1133,7 @@ GML3.prototype.ENVELOPE_SERIALIZERS_ = {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
@@ -1147,7 +1147,7 @@ GML3.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.POINTMEMBER_SERIALIZERS_ = {
|
||||
@@ -1159,7 +1159,7 @@ GML3.prototype.POINTMEMBER_SERIALIZERS_ = {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
@@ -1173,7 +1173,7 @@ GML3.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.GEOMETRY_SERIALIZERS_ = {
|
||||
|
||||
@@ -87,12 +87,12 @@ const ONLY_WHITESPACE_RE = /^[\s\xa0]*$/;
|
||||
class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {module:ol/format/GMLBase~Options=} opt_options Optional configuration object.
|
||||
* @param {Options=} opt_options Optional configuration object.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
super();
|
||||
|
||||
const options = /** @type {module:ol/format/GMLBase~Options} */ (opt_options ? opt_options : {});
|
||||
const options = /** @type {Options} */ (opt_options ? opt_options : {});
|
||||
|
||||
/**
|
||||
* @protected
|
||||
@@ -132,7 +132,7 @@ class GMLBase extends XMLFeature {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<module:ol/Feature> | undefined} Features.
|
||||
* @return {Array<import("../Feature.js").default> | undefined} Features.
|
||||
*/
|
||||
readFeaturesInternal(node, objectStack) {
|
||||
const localName = node.localName;
|
||||
@@ -220,17 +220,17 @@ class GMLBase extends XMLFeature {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/Geometry|undefined} Geometry.
|
||||
* @return {import("../geom/Geometry.js").default|undefined} Geometry.
|
||||
*/
|
||||
readGeometryElement(node, objectStack) {
|
||||
const context = /** @type {Object} */ (objectStack[0]);
|
||||
context['srsName'] = node.firstElementChild.getAttribute('srsName');
|
||||
context['srsDimension'] = node.firstElementChild.getAttribute('srsDimension');
|
||||
/** @type {module:ol/geom/Geometry} */
|
||||
/** @type {import("../geom/Geometry.js").default} */
|
||||
const geometry = pushParseAndPop(null, this.GEOMETRY_PARSERS_, node, objectStack, this);
|
||||
if (geometry) {
|
||||
return (
|
||||
/** @type {module:ol/geom/Geometry} */ (transformWithOptions(geometry, false, context))
|
||||
/** @type {import("../geom/Geometry.js").default} */ (transformWithOptions(geometry, false, context))
|
||||
);
|
||||
} else {
|
||||
return undefined;
|
||||
@@ -240,7 +240,7 @@ class GMLBase extends XMLFeature {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/Feature} Feature.
|
||||
* @return {import("../Feature.js").default} Feature.
|
||||
*/
|
||||
readFeatureElement(node, objectStack) {
|
||||
let n;
|
||||
@@ -281,7 +281,7 @@ class GMLBase extends XMLFeature {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/Point|undefined} Point.
|
||||
* @return {import("../geom/Point.js").default|undefined} Point.
|
||||
*/
|
||||
readPoint(node, objectStack) {
|
||||
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||
@@ -293,7 +293,7 @@ class GMLBase extends XMLFeature {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/MultiPoint|undefined} MultiPoint.
|
||||
* @return {import("../geom/MultiPoint.js").default|undefined} MultiPoint.
|
||||
*/
|
||||
readMultiPoint(node, objectStack) {
|
||||
/** @type {Array<Array<number>>} */
|
||||
@@ -309,10 +309,10 @@ class GMLBase extends XMLFeature {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
||||
* @return {import("../geom/MultiLineString.js").default|undefined} MultiLineString.
|
||||
*/
|
||||
readMultiLineString(node, objectStack) {
|
||||
/** @type {Array<module:ol/geom/LineString>} */
|
||||
/** @type {Array<import("../geom/LineString.js").default>} */
|
||||
const lineStrings = pushParseAndPop([],
|
||||
this.MULTILINESTRING_PARSERS_, node, objectStack, this);
|
||||
if (lineStrings) {
|
||||
@@ -323,10 +323,10 @@ class GMLBase extends XMLFeature {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/MultiPolygon|undefined} MultiPolygon.
|
||||
* @return {import("../geom/MultiPolygon.js").default|undefined} MultiPolygon.
|
||||
*/
|
||||
readMultiPolygon(node, objectStack) {
|
||||
/** @type {Array<module:ol/geom/Polygon>} */
|
||||
/** @type {Array<import("../geom/Polygon.js").default>} */
|
||||
const polygons = pushParseAndPop([], this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
|
||||
if (polygons) {
|
||||
return new MultiPolygon(polygons);
|
||||
@@ -363,7 +363,7 @@ class GMLBase extends XMLFeature {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/LineString|undefined} LineString.
|
||||
* @return {import("../geom/LineString.js").default|undefined} LineString.
|
||||
*/
|
||||
readLineString(node, objectStack) {
|
||||
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||
@@ -395,7 +395,7 @@ class GMLBase extends XMLFeature {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/LinearRing|undefined} LinearRing.
|
||||
* @return {import("../geom/LinearRing.js").default|undefined} LinearRing.
|
||||
*/
|
||||
readLinearRing(node, objectStack) {
|
||||
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||
@@ -407,7 +407,7 @@ class GMLBase extends XMLFeature {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
||||
* @return {import("../geom/Polygon.js").default|undefined} Polygon.
|
||||
*/
|
||||
readPolygon(node, objectStack) {
|
||||
/** @type {Array<Array<number>>} */
|
||||
@@ -471,7 +471,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GMLBase.prototype.MULTIPOINT_PARSERS_ = {
|
||||
@@ -484,7 +484,7 @@ GMLBase.prototype.MULTIPOINT_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
||||
@@ -497,7 +497,7 @@ GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
|
||||
@@ -510,7 +510,7 @@ GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GMLBase.prototype.POINTMEMBER_PARSERS_ = {
|
||||
@@ -522,7 +522,7 @@ GMLBase.prototype.POINTMEMBER_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
||||
@@ -534,7 +534,7 @@ GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
||||
@@ -546,7 +546,7 @@ GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
* @protected
|
||||
*/
|
||||
GMLBase.prototype.RING_PARSERS = {
|
||||
|
||||
@@ -38,7 +38,7 @@ const SCHEMA_LOCATION = 'http://www.topografix.com/GPX/1/1 ' +
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, function(Node, Array<*>): (module:ol/Feature|undefined)>}
|
||||
* @type {Object<string, function(Node, Array<*>): (import("../Feature.js").default|undefined)>}
|
||||
*/
|
||||
const FEATURE_READER = {
|
||||
'rte': readRte,
|
||||
@@ -49,7 +49,7 @@ const FEATURE_READER = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const GPX_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -61,7 +61,7 @@ const GPX_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const LINK_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -72,7 +72,7 @@ const LINK_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
*/
|
||||
const GPX_SERIALIZERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -84,7 +84,7 @@ const GPX_SERIALIZERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {function(module:ol/Feature, Node)} [readExtensions] Callback function
|
||||
* @property {function(import("../Feature.js").default, Node)} [readExtensions] Callback function
|
||||
* to process `extensions` nodes. To prevent memory leaks, this callback function must
|
||||
* not store any references to the node. Note that the `extensions`
|
||||
* node is not allowed in GPX 1.0. Moreover, only `extensions`
|
||||
@@ -117,7 +117,7 @@ const GPX_SERIALIZERS = makeStructureNS(
|
||||
class GPX extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {module:ol/format/GPX~Options=} opt_options Options.
|
||||
* @param {Options=} opt_options Options.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
super();
|
||||
@@ -131,14 +131,14 @@ class GPX extends XMLFeature {
|
||||
this.dataProjection = getProjection('EPSG:4326');
|
||||
|
||||
/**
|
||||
* @type {function(module:ol/Feature, Node)|undefined}
|
||||
* @type {function(import("../Feature.js").default, Node)|undefined}
|
||||
* @private
|
||||
*/
|
||||
this.readExtensions_ = options.readExtensions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array<module:ol/Feature>} features List of features.
|
||||
* @param {Array<import("../Feature.js").default>} features List of features.
|
||||
* @private
|
||||
*/
|
||||
handleReadExtensions_(features) {
|
||||
@@ -182,7 +182,7 @@ class GPX extends XMLFeature {
|
||||
return [];
|
||||
}
|
||||
if (node.localName == 'gpx') {
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
/** @type {Array<import("../Feature.js").default>} */
|
||||
const features = pushParseAndPop([], GPX_PARSERS,
|
||||
node, [this.getReadOptions(node, opt_options)]);
|
||||
if (features) {
|
||||
@@ -200,8 +200,8 @@ class GPX extends XMLFeature {
|
||||
* LineString geometries are output as routes (`<rte>`), and MultiLineString
|
||||
* as tracks (`<trk>`).
|
||||
*
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @param {Array<import("../Feature.js").default>} features Features.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||
* @return {Node} Node.
|
||||
* @override
|
||||
* @api
|
||||
@@ -216,7 +216,7 @@ class GPX extends XMLFeature {
|
||||
gpx.setAttribute('version', '1.1');
|
||||
gpx.setAttribute('creator', 'OpenLayers');
|
||||
|
||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
||||
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
|
||||
({node: gpx}), GPX_SERIALIZERS, GPX_NODE_FACTORY, features, [opt_options]);
|
||||
return gpx;
|
||||
}
|
||||
@@ -225,7 +225,7 @@ class GPX extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const RTE_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -243,7 +243,7 @@ const RTE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const RTEPT_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -254,7 +254,7 @@ const RTEPT_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const TRK_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -272,7 +272,7 @@ const TRK_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const TRKSEG_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -282,7 +282,7 @@ const TRKSEG_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const TRKPT_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -293,7 +293,7 @@ const TRKPT_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const WPT_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -328,7 +328,7 @@ const LINK_SEQUENCE = ['text', 'type'];
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
*/
|
||||
const LINK_SERIALIZERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -349,7 +349,7 @@ const RTE_SEQUENCE = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
*/
|
||||
const RTE_SERIALIZERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -386,7 +386,7 @@ const TRK_SEQUENCE = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
*/
|
||||
const TRK_SERIALIZERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -410,7 +410,7 @@ const TRKSEG_NODE_FACTORY = makeSimpleNodeFactory('trkpt');
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
*/
|
||||
const TRKSEG_SERIALIZERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -432,7 +432,7 @@ const WPT_TYPE_SEQUENCE = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
*/
|
||||
const WPT_TYPE_SERIALIZERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -475,7 +475,7 @@ const GEOMETRY_TYPE_TO_NODENAME = {
|
||||
* @return {Node|undefined} Node.
|
||||
*/
|
||||
function GPX_NODE_FACTORY(value, objectStack, opt_nodeName) {
|
||||
const geometry = /** @type {module:ol/Feature} */ (value).getGeometry();
|
||||
const geometry = /** @type {import("../Feature.js").default} */ (value).getGeometry();
|
||||
if (geometry) {
|
||||
const nodeName = GEOMETRY_TYPE_TO_NODENAME[geometry.getType()];
|
||||
if (nodeName) {
|
||||
@@ -488,7 +488,7 @@ function GPX_NODE_FACTORY(value, objectStack, opt_nodeName) {
|
||||
|
||||
/**
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {module:ol/format/GPX~LayoutOptions} layoutOptions Layout options.
|
||||
* @param {LayoutOptions} layoutOptions Layout options.
|
||||
* @param {Element} node Node.
|
||||
* @param {!Object} values Values.
|
||||
* @return {Array<number>} Flat coordinates.
|
||||
@@ -519,10 +519,10 @@ function appendCoordinate(flatCoordinates, layoutOptions, node, values) {
|
||||
* Choose GeometryLayout based on flags in layoutOptions and adjust flatCoordinates
|
||||
* and ends arrays by shrinking them accordingly (removing unused zero entries).
|
||||
*
|
||||
* @param {module:ol/format/GPX~LayoutOptions} layoutOptions Layout options.
|
||||
* @param {LayoutOptions} layoutOptions Layout options.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>=} ends Ends.
|
||||
* @return {module:ol/geom/GeometryLayout} Layout.
|
||||
* @return {import("../geom/GeometryLayout.js").default} Layout.
|
||||
*/
|
||||
function applyLayoutOptions(layoutOptions, flatCoordinates, ends) {
|
||||
let layout = GeometryLayout.XY;
|
||||
@@ -592,7 +592,7 @@ function parseRtePt(node, objectStack) {
|
||||
if (values) {
|
||||
const rteValues = /** @type {!Object} */ (objectStack[objectStack.length - 1]);
|
||||
const flatCoordinates = /** @type {Array<number>} */ (rteValues['flatCoordinates']);
|
||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (rteValues['layoutOptions']);
|
||||
const layoutOptions = /** @type {LayoutOptions} */ (rteValues['layoutOptions']);
|
||||
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
||||
}
|
||||
}
|
||||
@@ -607,7 +607,7 @@ function parseTrkPt(node, objectStack) {
|
||||
if (values) {
|
||||
const trkValues = /** @type {!Object} */ (objectStack[objectStack.length - 1]);
|
||||
const flatCoordinates = /** @type {Array<number>} */ (trkValues['flatCoordinates']);
|
||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (trkValues['layoutOptions']);
|
||||
const layoutOptions = /** @type {LayoutOptions} */ (trkValues['layoutOptions']);
|
||||
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
||||
}
|
||||
}
|
||||
@@ -630,10 +630,10 @@ function parseTrkSeg(node, objectStack) {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/Feature|undefined} Track.
|
||||
* @return {import("../Feature.js").default|undefined} Track.
|
||||
*/
|
||||
function readRte(node, objectStack) {
|
||||
const options = /** @type {module:ol/format/Feature~ReadOptions} */ (objectStack[0]);
|
||||
const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]);
|
||||
const values = pushParseAndPop({
|
||||
'flatCoordinates': [],
|
||||
'layoutOptions': {}
|
||||
@@ -644,7 +644,7 @@ function readRte(node, objectStack) {
|
||||
const flatCoordinates = /** @type {Array<number>} */
|
||||
(values['flatCoordinates']);
|
||||
delete values['flatCoordinates'];
|
||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (values['layoutOptions']);
|
||||
const layoutOptions = /** @type {LayoutOptions} */ (values['layoutOptions']);
|
||||
delete values['layoutOptions'];
|
||||
const layout = applyLayoutOptions(layoutOptions, flatCoordinates);
|
||||
const geometry = new LineString(flatCoordinates, layout);
|
||||
@@ -658,10 +658,10 @@ function readRte(node, objectStack) {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/Feature|undefined} Track.
|
||||
* @return {import("../Feature.js").default|undefined} Track.
|
||||
*/
|
||||
function readTrk(node, objectStack) {
|
||||
const options = /** @type {module:ol/format/Feature~ReadOptions} */ (objectStack[0]);
|
||||
const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]);
|
||||
const values = pushParseAndPop({
|
||||
'flatCoordinates': [],
|
||||
'ends': [],
|
||||
@@ -675,7 +675,7 @@ function readTrk(node, objectStack) {
|
||||
delete values['flatCoordinates'];
|
||||
const ends = /** @type {Array<number>} */ (values['ends']);
|
||||
delete values['ends'];
|
||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (values['layoutOptions']);
|
||||
const layoutOptions = /** @type {LayoutOptions} */ (values['layoutOptions']);
|
||||
delete values['layoutOptions'];
|
||||
const layout = applyLayoutOptions(layoutOptions, flatCoordinates, ends);
|
||||
const geometry = new MultiLineString(flatCoordinates, layout, ends);
|
||||
@@ -689,15 +689,15 @@ function readTrk(node, objectStack) {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/Feature|undefined} Waypoint.
|
||||
* @return {import("../Feature.js").default|undefined} Waypoint.
|
||||
*/
|
||||
function readWpt(node, objectStack) {
|
||||
const options = /** @type {module:ol/format/Feature~ReadOptions} */ (objectStack[0]);
|
||||
const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]);
|
||||
const values = pushParseAndPop({}, WPT_PARSERS, node, objectStack);
|
||||
if (!values) {
|
||||
return undefined;
|
||||
}
|
||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ ({});
|
||||
const layoutOptions = /** @type {LayoutOptions} */ ({});
|
||||
const coordinates = appendCoordinate([], layoutOptions, node, values);
|
||||
const layout = applyLayoutOptions(layoutOptions, coordinates);
|
||||
const geometry = new Point(coordinates, layout);
|
||||
@@ -721,7 +721,7 @@ function writeLink(node, value, objectStack) {
|
||||
properties['linkText'],
|
||||
properties['linkType']
|
||||
];
|
||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */ ({node: node}),
|
||||
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */ ({node: node}),
|
||||
LINK_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY,
|
||||
link, objectStack, LINK_SEQUENCE);
|
||||
}
|
||||
@@ -729,7 +729,7 @@ function writeLink(node, value, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeWptType(node, coordinate, objectStack) {
|
||||
@@ -764,7 +764,7 @@ function writeWptType(node, coordinate, objectStack) {
|
||||
RTEPT_TYPE_SEQUENCE[namespaceURI] :
|
||||
WPT_TYPE_SEQUENCE[namespaceURI];
|
||||
const values = makeSequence(properties, orderedKeys);
|
||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
||||
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
|
||||
({node: node, 'properties': properties}),
|
||||
WPT_TYPE_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY,
|
||||
values, objectStack, orderedKeys);
|
||||
@@ -773,16 +773,16 @@ function writeWptType(node, coordinate, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeRte(node, feature, objectStack) {
|
||||
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
||||
const options = /** @type {import("./Feature.js").WriteOptions} */ (objectStack[0]);
|
||||
const properties = feature.getProperties();
|
||||
const context = {node: node, 'properties': properties};
|
||||
let geometry = feature.getGeometry();
|
||||
if (geometry) {
|
||||
geometry = /** @type {module:ol/geom/LineString} */ (transformWithOptions(geometry, true, options));
|
||||
geometry = /** @type {import("../geom/LineString.js").default} */ (transformWithOptions(geometry, true, options));
|
||||
context['geometryLayout'] = geometry.getLayout();
|
||||
properties['rtept'] = geometry.getCoordinates();
|
||||
}
|
||||
@@ -797,17 +797,17 @@ function writeRte(node, feature, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeTrk(node, feature, objectStack) {
|
||||
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
||||
const options = /** @type {import("./Feature.js").WriteOptions} */ (objectStack[0]);
|
||||
const properties = feature.getProperties();
|
||||
/** @type {module:ol/xml~NodeStackItem} */
|
||||
/** @type {import("../xml.js").NodeStackItem} */
|
||||
const context = {node: node, 'properties': properties};
|
||||
let geometry = feature.getGeometry();
|
||||
if (geometry) {
|
||||
geometry = /** @type {module:ol/geom/MultiLineString} */
|
||||
geometry = /** @type {import("../geom/MultiLineString.js").default} */
|
||||
(transformWithOptions(geometry, true, options));
|
||||
properties['trkseg'] = geometry.getLineStrings();
|
||||
}
|
||||
@@ -822,11 +822,11 @@ function writeTrk(node, feature, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString} lineString LineString.
|
||||
* @param {import("../geom/LineString.js").default} lineString LineString.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeTrkSeg(node, lineString, objectStack) {
|
||||
/** @type {module:ol/xml~NodeStackItem} */
|
||||
/** @type {import("../xml.js").NodeStackItem} */
|
||||
const context = {node: node, 'geometryLayout': lineString.getLayout(),
|
||||
'properties': {}};
|
||||
pushSerializeAndPop(context,
|
||||
@@ -837,16 +837,16 @@ function writeTrkSeg(node, lineString, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeWpt(node, feature, objectStack) {
|
||||
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
||||
const options = /** @type {import("./Feature.js").WriteOptions} */ (objectStack[0]);
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
context['properties'] = feature.getProperties();
|
||||
let geometry = feature.getGeometry();
|
||||
if (geometry) {
|
||||
geometry = /** @type {module:ol/geom/Point} */
|
||||
geometry = /** @type {import("../geom/Point.js").default} */
|
||||
(transformWithOptions(geometry, true, options));
|
||||
context['geometryLayout'] = geometry.getLayout();
|
||||
writeWptType(node, geometry.getCoordinates(), objectStack);
|
||||
|
||||
@@ -21,8 +21,8 @@ import {get as getProjection} from '../proj.js';
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {module:ol/proj~ProjectionLike} [dataProjection='EPSG:4326'] Default data projection.
|
||||
* @property {module:ol/proj~ProjectionLike} [featureProjection] Projection for features read or
|
||||
* @property {import("../proj.js").ProjectionLike} [dataProjection='EPSG:4326'] Default data projection.
|
||||
* @property {import("../proj.js").ProjectionLike} [featureProjection] Projection for features read or
|
||||
* written by the format. Options passed to read or write methods will take precedence.
|
||||
* @property {string} [geometryName] Geometry name to use when creating features.
|
||||
* @property {boolean} [extractGeometryName=false] Certain GeoJSON providers include
|
||||
@@ -41,7 +41,7 @@ import {get as getProjection} from '../proj.js';
|
||||
class GeoJSON extends JSONFeature {
|
||||
|
||||
/**
|
||||
* @param {module:ol/format/GeoJSON~Options=} opt_options Options.
|
||||
* @param {Options=} opt_options Options.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
|
||||
@@ -115,7 +115,7 @@ class GeoJSON extends JSONFeature {
|
||||
*/
|
||||
readFeaturesFromObject(object, opt_options) {
|
||||
const geoJSONObject = /** @type {GeoJSONObject} */ (object);
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
/** @type {Array<import("../Feature.js").default>} */
|
||||
let features = null;
|
||||
if (geoJSONObject.type === 'FeatureCollection') {
|
||||
const geoJSONFeatureCollection = /** @type {GeoJSONFeatureCollection} */ (object);
|
||||
@@ -154,15 +154,15 @@ class GeoJSON extends JSONFeature {
|
||||
projection = this.dataProjection;
|
||||
}
|
||||
return (
|
||||
/** @type {module:ol/proj/Projection} */ (projection)
|
||||
/** @type {import("../proj/Projection.js").default} */ (projection)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode a feature as a GeoJSON Feature object.
|
||||
*
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {GeoJSONFeature} Object.
|
||||
* @override
|
||||
* @api
|
||||
@@ -196,8 +196,8 @@ class GeoJSON extends JSONFeature {
|
||||
/**
|
||||
* Encode an array of features as a GeoJSON object.
|
||||
*
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {Array<import("../Feature.js").default>} features Features.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {GeoJSONFeatureCollection} GeoJSON Object.
|
||||
* @override
|
||||
* @api
|
||||
@@ -217,8 +217,8 @@ class GeoJSON extends JSONFeature {
|
||||
/**
|
||||
* Encode a geometry as a GeoJSON object.
|
||||
*
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {GeoJSONGeometry|GeoJSONGeometryCollection} Object.
|
||||
* @override
|
||||
* @api
|
||||
@@ -231,7 +231,7 @@ class GeoJSON extends JSONFeature {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, function(GeoJSONObject): module:ol/geom/Geometry>}
|
||||
* @type {Object<string, function(GeoJSONObject): import("../geom/Geometry.js").default>}
|
||||
*/
|
||||
const GEOMETRY_READERS = {
|
||||
'Point': readPointGeometry,
|
||||
@@ -246,7 +246,7 @@ const GEOMETRY_READERS = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, function(module:ol/geom/Geometry, module:ol/format/Feature~WriteOptions=): (GeoJSONGeometry|GeoJSONGeometryCollection)>}
|
||||
* @type {Object<string, function(import("../geom/Geometry.js").default, import("./Feature.js").WriteOptions=): (GeoJSONGeometry|GeoJSONGeometryCollection)>}
|
||||
*/
|
||||
const GEOMETRY_WRITERS = {
|
||||
'Point': writePointGeometry,
|
||||
@@ -262,8 +262,8 @@ const GEOMETRY_WRITERS = {
|
||||
|
||||
/**
|
||||
* @param {GeoJSONGeometry|GeoJSONGeometryCollection} object Object.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {module:ol/geom/Geometry} Geometry.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||
*/
|
||||
function readGeometry(object, opt_options) {
|
||||
if (!object) {
|
||||
@@ -271,21 +271,21 @@ function readGeometry(object, opt_options) {
|
||||
}
|
||||
const geometryReader = GEOMETRY_READERS[object.type];
|
||||
return (
|
||||
/** @type {module:ol/geom/Geometry} */ (transformWithOptions(geometryReader(object), false, opt_options))
|
||||
/** @type {import("../geom/Geometry.js").default} */ (transformWithOptions(geometryReader(object), false, opt_options))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {GeoJSONGeometryCollection} object Object.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {module:ol/geom/GeometryCollection} Geometry collection.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @return {import("../geom/GeometryCollection.js").default} Geometry collection.
|
||||
*/
|
||||
function readGeometryCollectionGeometry(object, opt_options) {
|
||||
const geometries = object.geometries.map(
|
||||
/**
|
||||
* @param {GeoJSONGeometry} geometry Geometry.
|
||||
* @return {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @return {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
*/
|
||||
function(geometry) {
|
||||
return readGeometry(geometry, opt_options);
|
||||
@@ -296,7 +296,7 @@ function readGeometryCollectionGeometry(object, opt_options) {
|
||||
|
||||
/**
|
||||
* @param {GeoJSONGeometry} object Object.
|
||||
* @return {module:ol/geom/Point} Point.
|
||||
* @return {import("../geom/Point.js").default} Point.
|
||||
*/
|
||||
function readPointGeometry(object) {
|
||||
return new Point(object.coordinates);
|
||||
@@ -305,7 +305,7 @@ function readPointGeometry(object) {
|
||||
|
||||
/**
|
||||
* @param {GeoJSONGeometry} object Object.
|
||||
* @return {module:ol/geom/LineString} LineString.
|
||||
* @return {import("../geom/LineString.js").default} LineString.
|
||||
*/
|
||||
function readLineStringGeometry(object) {
|
||||
return new LineString(object.coordinates);
|
||||
@@ -314,7 +314,7 @@ function readLineStringGeometry(object) {
|
||||
|
||||
/**
|
||||
* @param {GeoJSONGeometry} object Object.
|
||||
* @return {module:ol/geom/MultiLineString} MultiLineString.
|
||||
* @return {import("../geom/MultiLineString.js").default} MultiLineString.
|
||||
*/
|
||||
function readMultiLineStringGeometry(object) {
|
||||
return new MultiLineString(object.coordinates);
|
||||
@@ -323,7 +323,7 @@ function readMultiLineStringGeometry(object) {
|
||||
|
||||
/**
|
||||
* @param {GeoJSONGeometry} object Object.
|
||||
* @return {module:ol/geom/MultiPoint} MultiPoint.
|
||||
* @return {import("../geom/MultiPoint.js").default} MultiPoint.
|
||||
*/
|
||||
function readMultiPointGeometry(object) {
|
||||
return new MultiPoint(object.coordinates);
|
||||
@@ -332,7 +332,7 @@ function readMultiPointGeometry(object) {
|
||||
|
||||
/**
|
||||
* @param {GeoJSONGeometry} object Object.
|
||||
* @return {module:ol/geom/MultiPolygon} MultiPolygon.
|
||||
* @return {import("../geom/MultiPolygon.js").default} MultiPolygon.
|
||||
*/
|
||||
function readMultiPolygonGeometry(object) {
|
||||
return new MultiPolygon(object.coordinates);
|
||||
@@ -341,7 +341,7 @@ function readMultiPolygonGeometry(object) {
|
||||
|
||||
/**
|
||||
* @param {GeoJSONGeometry} object Object.
|
||||
* @return {module:ol/geom/Polygon} Polygon.
|
||||
* @return {import("../geom/Polygon.js").default} Polygon.
|
||||
*/
|
||||
function readPolygonGeometry(object) {
|
||||
return new Polygon(object.coordinates);
|
||||
@@ -349,19 +349,19 @@ function readPolygonGeometry(object) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {GeoJSONGeometry|GeoJSONGeometryCollection} GeoJSON geometry.
|
||||
*/
|
||||
function writeGeometry(geometry, opt_options) {
|
||||
const geometryWriter = GEOMETRY_WRITERS[geometry.getType()];
|
||||
return geometryWriter(/** @type {module:ol/geom/Geometry} */ (
|
||||
return geometryWriter(/** @type {import("../geom/Geometry.js").default} */ (
|
||||
transformWithOptions(geometry, true, opt_options)), opt_options);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @return {GeoJSONGeometryCollection} Empty GeoJSON geometry collection.
|
||||
*/
|
||||
function writeEmptyGeometryCollectionGeometry(geometry) {
|
||||
@@ -373,8 +373,8 @@ function writeEmptyGeometryCollectionGeometry(geometry) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/GeometryCollection} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/GeometryCollection.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {GeoJSONGeometryCollection} GeoJSON geometry collection.
|
||||
*/
|
||||
function writeGeometryCollectionGeometry(geometry, opt_options) {
|
||||
@@ -391,8 +391,8 @@ function writeGeometryCollectionGeometry(geometry, opt_options) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/LineString} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/LineString.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||
*/
|
||||
function writeLineStringGeometry(geometry, opt_options) {
|
||||
@@ -404,8 +404,8 @@ function writeLineStringGeometry(geometry, opt_options) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/MultiLineString} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/MultiLineString.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||
*/
|
||||
function writeMultiLineStringGeometry(geometry, opt_options) {
|
||||
@@ -417,8 +417,8 @@ function writeMultiLineStringGeometry(geometry, opt_options) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/MultiPoint} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/MultiPoint.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||
*/
|
||||
function writeMultiPointGeometry(geometry, opt_options) {
|
||||
@@ -430,8 +430,8 @@ function writeMultiPointGeometry(geometry, opt_options) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/MultiPolygon} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/MultiPolygon.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||
*/
|
||||
function writeMultiPolygonGeometry(geometry, opt_options) {
|
||||
@@ -447,8 +447,8 @@ function writeMultiPolygonGeometry(geometry, opt_options) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Point} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/Point.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||
*/
|
||||
function writePointGeometry(geometry, opt_options) {
|
||||
@@ -460,8 +460,8 @@ function writePointGeometry(geometry, opt_options) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Polygon} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/Polygon.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||
*/
|
||||
function writePolygonGeometry(geometry, opt_options) {
|
||||
|
||||
@@ -69,7 +69,7 @@ const NEWLINE_RE = /\r\n|\r|\n/;
|
||||
class IGC extends TextFeature {
|
||||
|
||||
/**
|
||||
* @param {module:ol/format/IGC~Options=} opt_options Options.
|
||||
* @param {Options=} opt_options Options.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
super();
|
||||
|
||||
@@ -29,8 +29,8 @@ class JSONFeature extends FeatureFormat {
|
||||
* read a feature collection.
|
||||
*
|
||||
* @param {ArrayBuffer|Document|Node|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {module:ol/Feature} Feature.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @return {import("../Feature.js").default} Feature.
|
||||
* @api
|
||||
*/
|
||||
readFeature(source, opt_options) {
|
||||
@@ -43,8 +43,8 @@ class JSONFeature extends FeatureFormat {
|
||||
* collection.
|
||||
*
|
||||
* @param {ArrayBuffer|Document|Node|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @return {Array<import("../Feature.js").default>} Features.
|
||||
* @api
|
||||
*/
|
||||
readFeatures(source, opt_options) {
|
||||
@@ -55,18 +55,18 @@ class JSONFeature extends FeatureFormat {
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Object} object Object.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @protected
|
||||
* @return {module:ol/Feature} Feature.
|
||||
* @return {import("../Feature.js").default} Feature.
|
||||
*/
|
||||
readFeatureFromObject(object, opt_options) {}
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Object} object Object.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @protected
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @return {Array<import("../Feature.js").default>} Features.
|
||||
*/
|
||||
readFeaturesFromObject(object, opt_options) {}
|
||||
|
||||
@@ -74,8 +74,8 @@ class JSONFeature extends FeatureFormat {
|
||||
* Read a geometry.
|
||||
*
|
||||
* @param {ArrayBuffer|Document|Node|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {module:ol/geom/Geometry} Geometry.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||
* @api
|
||||
*/
|
||||
readGeometry(source, opt_options) {
|
||||
@@ -86,9 +86,9 @@ class JSONFeature extends FeatureFormat {
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Object} object Object.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @protected
|
||||
* @return {module:ol/geom/Geometry} Geometry.
|
||||
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||
*/
|
||||
readGeometryFromObject(object, opt_options) {}
|
||||
|
||||
@@ -96,7 +96,7 @@ class JSONFeature extends FeatureFormat {
|
||||
* Read the projection.
|
||||
*
|
||||
* @param {ArrayBuffer|Document|Node|Object|string} source Source.
|
||||
* @return {module:ol/proj/Projection} Projection.
|
||||
* @return {import("../proj/Projection.js").default} Projection.
|
||||
* @api
|
||||
*/
|
||||
readProjection(source) {
|
||||
@@ -107,15 +107,15 @@ class JSONFeature extends FeatureFormat {
|
||||
* @abstract
|
||||
* @param {Object} object Object.
|
||||
* @protected
|
||||
* @return {module:ol/proj/Projection} Projection.
|
||||
* @return {import("../proj/Projection.js").default} Projection.
|
||||
*/
|
||||
readProjectionFromObject(object) {}
|
||||
|
||||
/**
|
||||
* Encode a feature as string.
|
||||
*
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {string} Encoded feature.
|
||||
* @api
|
||||
*/
|
||||
@@ -125,8 +125,8 @@ class JSONFeature extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {Object} Object.
|
||||
*/
|
||||
writeFeatureObject(feature, opt_options) {}
|
||||
@@ -134,8 +134,8 @@ class JSONFeature extends FeatureFormat {
|
||||
/**
|
||||
* Encode an array of features as string.
|
||||
*
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {Array<import("../Feature.js").default>} features Features.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {string} Encoded features.
|
||||
* @api
|
||||
*/
|
||||
@@ -145,8 +145,8 @@ class JSONFeature extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {Array<import("../Feature.js").default>} features Features.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {Object} Object.
|
||||
*/
|
||||
writeFeaturesObject(features, opt_options) {}
|
||||
@@ -154,8 +154,8 @@ class JSONFeature extends FeatureFormat {
|
||||
/**
|
||||
* Encode a geometry as string.
|
||||
*
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {string} Encoded geometry.
|
||||
* @api
|
||||
*/
|
||||
@@ -165,8 +165,8 @@ class JSONFeature extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {Object} Object.
|
||||
*/
|
||||
writeGeometryObject(geometry, opt_options) {}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,7 @@ import RenderFeature from '../render/Feature.js';
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {function((module:ol/geom/Geometry|Object<string,*>)=)|function(module:ol/geom/GeometryType,Array<number>,(Array<number>|Array<Array<number>>),Object<string,*>,number)} [featureClass]
|
||||
* @property {function((import("../geom/Geometry.js").default|Object<string,*>)=)|function(import("../geom/GeometryType.js").default,Array<number>,(Array<number>|Array<Array<number>>),Object<string,*>,number)} [featureClass]
|
||||
* Class for features returned by {@link module:ol/format/MVT#readFeatures}. Set to
|
||||
* {@link module:ol/Feature~Feature} to get full editing and geometry support at the cost of
|
||||
* decreased rendering performance. The default is {@link module:ol/render/Feature~RenderFeature},
|
||||
@@ -41,13 +41,13 @@ import RenderFeature from '../render/Feature.js';
|
||||
* @classdesc
|
||||
* Feature format for reading data in the Mapbox MVT format.
|
||||
*
|
||||
* @param {module:ol/format/MVT~Options=} opt_options Options.
|
||||
* @param {Options=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
class MVT extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @param {module:ol/format/MVT~Options=} opt_options Options.
|
||||
* @param {Options=} opt_options Options.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
super();
|
||||
@@ -55,7 +55,7 @@ class MVT extends FeatureFormat {
|
||||
const options = opt_options ? opt_options : {};
|
||||
|
||||
/**
|
||||
* @type {module:ol/proj/Projection}
|
||||
* @type {import("../proj/Projection.js").default}
|
||||
*/
|
||||
this.dataProjection = new Projection({
|
||||
code: '',
|
||||
@@ -64,8 +64,8 @@ class MVT extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {function((module:ol/geom/Geometry|Object<string,*>)=)|
|
||||
* function(module:ol/geom/GeometryType,Array<number>,
|
||||
* @type {function((import("../geom/Geometry.js").default|Object<string,*>)=)|
|
||||
* function(import("../geom/GeometryType.js").default,Array<number>,
|
||||
* (Array<number>|Array<Array<number>>),Object<string,*>,number)}
|
||||
*/
|
||||
this.featureClass_ = options.featureClass ?
|
||||
@@ -91,7 +91,7 @@ class MVT extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("../extent.js").Extent}
|
||||
*/
|
||||
this.extent_ = null;
|
||||
|
||||
@@ -166,8 +166,8 @@ class MVT extends FeatureFormat {
|
||||
* @private
|
||||
* @param {Object} pbf PBF
|
||||
* @param {Object} rawFeature Raw Mapbox feature.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {module:ol/Feature|module:ol/render/Feature} Feature.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @return {import("../Feature.js").default|import("../render/Feature.js").default} Feature.
|
||||
*/
|
||||
createFeature_(pbf, rawFeature, opt_options) {
|
||||
const type = rawFeature.type;
|
||||
@@ -252,7 +252,7 @@ class MVT extends FeatureFormat {
|
||||
|
||||
const pbf = new PBF(/** @type {ArrayBuffer} */ (source));
|
||||
const pbfLayers = pbf.readFields(layersPBFReader, {});
|
||||
/** @type {Array<module:ol/Feature|module:ol/render/Feature>} */
|
||||
/** @type {Array<import("../Feature.js").default|import("../render/Feature.js").default>} */
|
||||
const features = [];
|
||||
for (const name in pbfLayers) {
|
||||
if (layers && layers.indexOf(name) == -1) {
|
||||
@@ -397,10 +397,10 @@ function readRawFeature(pbf, layer, i) {
|
||||
* @param {number} type The raw feature's geometry type
|
||||
* @param {number} numEnds Number of ends of the flat coordinates of the
|
||||
* geometry.
|
||||
* @return {module:ol/geom/GeometryType} The geometry type.
|
||||
* @return {import("../geom/GeometryType.js").default} The geometry type.
|
||||
*/
|
||||
function getGeometryType(type, numEnds) {
|
||||
/** @type {module:ol/geom/GeometryType} */
|
||||
/** @type {import("../geom/GeometryType.js").default} */
|
||||
let geometryType;
|
||||
if (type === 1) {
|
||||
geometryType = numEnds === 1 ?
|
||||
|
||||
@@ -24,7 +24,7 @@ const NAMESPACE_URIS = [null];
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const WAY_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -35,7 +35,7 @@ const WAY_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -106,7 +106,7 @@ class OSMXML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const NODE_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -119,10 +119,10 @@ const NODE_PARSERS = makeStructureNS(
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function readNode(node, objectStack) {
|
||||
const options = /** @type {module:ol/format/Feature~ReadOptions} */ (objectStack[0]);
|
||||
const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]);
|
||||
const state = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
const id = node.getAttribute('id');
|
||||
/** @type {module:ol/coordinate~Coordinate} */
|
||||
/** @type {import("../coordinate.js").Coordinate} */
|
||||
const coordinates = [
|
||||
parseFloat(node.getAttribute('lon')),
|
||||
parseFloat(node.getAttribute('lat'))
|
||||
|
||||
@@ -16,7 +16,7 @@ const NAMESPACE_URIS = [null, 'http://www.opengis.net/ows/1.1'];
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -56,7 +56,7 @@ class OWS extends XML {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const ADDRESS_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -71,7 +71,7 @@ const ADDRESS_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const ALLOWED_VALUES_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -81,7 +81,7 @@ const ALLOWED_VALUES_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const CONSTRAINT_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -91,7 +91,7 @@ const CONSTRAINT_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const CONTACT_INFO_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -102,7 +102,7 @@ const CONTACT_INFO_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const DCP_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -112,7 +112,7 @@ const DCP_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const HTTP_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -123,7 +123,7 @@ const HTTP_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const OPERATION_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -133,7 +133,7 @@ const OPERATION_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const OPERATIONS_METADATA_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -143,7 +143,7 @@ const OPERATIONS_METADATA_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const PHONE_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -154,7 +154,7 @@ const PHONE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const REQUEST_METHOD_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -164,7 +164,7 @@ const REQUEST_METHOD_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const SERVICE_CONTACT_PARSERS =
|
||||
makeStructureNS(
|
||||
@@ -177,7 +177,7 @@ const SERVICE_CONTACT_PARSERS =
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const SERVICE_IDENTIFICATION_PARSERS =
|
||||
makeStructureNS(
|
||||
@@ -193,7 +193,7 @@ const SERVICE_IDENTIFICATION_PARSERS =
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const SERVICE_PROVIDER_PARSERS =
|
||||
makeStructureNS(
|
||||
|
||||
@@ -16,7 +16,7 @@ import {get as getProjection} from '../proj.js';
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {number} [factor=1e5] The factor by which the coordinates values will be scaled.
|
||||
* @property {module:ol/geom/GeometryLayout} [geometryLayout='XY'] Layout of the
|
||||
* @property {import("../geom/GeometryLayout.js").default} [geometryLayout='XY'] Layout of the
|
||||
* feature geometries created by the format reader.
|
||||
*/
|
||||
|
||||
@@ -38,7 +38,7 @@ import {get as getProjection} from '../proj.js';
|
||||
class Polyline extends TextFeature {
|
||||
|
||||
/**
|
||||
* @param {module:ol/format/Polyline~Options=} opt_options Optional configuration object.
|
||||
* @param {Options=} opt_options Optional configuration object.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
super();
|
||||
@@ -59,7 +59,7 @@ class Polyline extends TextFeature {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/geom/GeometryLayout}
|
||||
* @type {import("../geom/GeometryLayout.js").default}
|
||||
*/
|
||||
this.geometryLayout_ = options.geometryLayout ?
|
||||
options.geometryLayout : GeometryLayout.XY;
|
||||
@@ -91,7 +91,7 @@ class Polyline extends TextFeature {
|
||||
const coordinates = inflateCoordinates(flatCoordinates, 0, flatCoordinates.length, stride);
|
||||
|
||||
return (
|
||||
/** @type {module:ol/geom/Geometry} */ (transformWithOptions(
|
||||
/** @type {import("../geom/Geometry.js").default} */ (transformWithOptions(
|
||||
new LineString(coordinates, this.geometryLayout_),
|
||||
false,
|
||||
this.adaptOptions(opt_options)
|
||||
@@ -123,7 +123,7 @@ class Polyline extends TextFeature {
|
||||
* @inheritDoc
|
||||
*/
|
||||
writeGeometryText(geometry, opt_options) {
|
||||
geometry = /** @type {module:ol/geom/LineString} */
|
||||
geometry = /** @type {import("../geom/LineString.js").default} */
|
||||
(transformWithOptions(geometry, true, this.adaptOptions(opt_options)));
|
||||
const flatCoordinates = geometry.getFlatCoordinates();
|
||||
const stride = geometry.getStride();
|
||||
|
||||
@@ -28,8 +28,8 @@ class TextFeature extends FeatureFormat {
|
||||
* Read the feature from the source.
|
||||
*
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {module:ol/Feature} Feature.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @return {import("../Feature.js").default} Feature.
|
||||
* @api
|
||||
*/
|
||||
readFeature(source, opt_options) {
|
||||
@@ -39,9 +39,9 @@ class TextFeature extends FeatureFormat {
|
||||
/**
|
||||
* @abstract
|
||||
* @param {string} text Text.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @protected
|
||||
* @return {module:ol/Feature} Feature.
|
||||
* @return {import("../Feature.js").default} Feature.
|
||||
*/
|
||||
readFeatureFromText(text, opt_options) {}
|
||||
|
||||
@@ -49,8 +49,8 @@ class TextFeature extends FeatureFormat {
|
||||
* Read the features from the source.
|
||||
*
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @return {Array<import("../Feature.js").default>} Features.
|
||||
* @api
|
||||
*/
|
||||
readFeatures(source, opt_options) {
|
||||
@@ -60,9 +60,9 @@ class TextFeature extends FeatureFormat {
|
||||
/**
|
||||
* @abstract
|
||||
* @param {string} text Text.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @protected
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @return {Array<import("../Feature.js").default>} Features.
|
||||
*/
|
||||
readFeaturesFromText(text, opt_options) {}
|
||||
|
||||
@@ -70,8 +70,8 @@ class TextFeature extends FeatureFormat {
|
||||
* Read the geometry from the source.
|
||||
*
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {module:ol/geom/Geometry} Geometry.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||
* @api
|
||||
*/
|
||||
readGeometry(source, opt_options) {
|
||||
@@ -81,9 +81,9 @@ class TextFeature extends FeatureFormat {
|
||||
/**
|
||||
* @abstract
|
||||
* @param {string} text Text.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @protected
|
||||
* @return {module:ol/geom/Geometry} Geometry.
|
||||
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||
*/
|
||||
readGeometryFromText(text, opt_options) {}
|
||||
|
||||
@@ -92,7 +92,7 @@ class TextFeature extends FeatureFormat {
|
||||
*
|
||||
* @function
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @return {module:ol/proj/Projection} Projection.
|
||||
* @return {import("../proj/Projection.js").default} Projection.
|
||||
* @api
|
||||
*/
|
||||
readProjection(source) {
|
||||
@@ -102,7 +102,7 @@ class TextFeature extends FeatureFormat {
|
||||
/**
|
||||
* @param {string} text Text.
|
||||
* @protected
|
||||
* @return {module:ol/proj/Projection} Projection.
|
||||
* @return {import("../proj/Projection.js").default} Projection.
|
||||
*/
|
||||
readProjectionFromText(text) {
|
||||
return this.dataProjection;
|
||||
@@ -112,8 +112,8 @@ class TextFeature extends FeatureFormat {
|
||||
* Encode a feature as a string.
|
||||
*
|
||||
* @function
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {string} Encoded feature.
|
||||
* @api
|
||||
*/
|
||||
@@ -123,8 +123,8 @@ class TextFeature extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {module:ol/Feature} feature Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../Feature.js").default} feature Features.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @protected
|
||||
* @return {string} Text.
|
||||
*/
|
||||
@@ -133,8 +133,8 @@ class TextFeature extends FeatureFormat {
|
||||
/**
|
||||
* Encode an array of features as string.
|
||||
*
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {Array<import("../Feature.js").default>} features Features.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {string} Encoded features.
|
||||
* @api
|
||||
*/
|
||||
@@ -144,8 +144,8 @@ class TextFeature extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {Array<import("../Feature.js").default>} features Features.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @protected
|
||||
* @return {string} Text.
|
||||
*/
|
||||
@@ -155,8 +155,8 @@ class TextFeature extends FeatureFormat {
|
||||
* Write a single geometry.
|
||||
*
|
||||
* @function
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {string} Geometry.
|
||||
* @api
|
||||
*/
|
||||
@@ -166,8 +166,8 @@ class TextFeature extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @protected
|
||||
* @return {string} Text.
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,7 @@ import {get as getProjection} from '../proj.js';
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {module:ol/proj~ProjectionLike} [dataProjection='EPSG:4326'] Default data projection.
|
||||
* @property {import("../proj.js").ProjectionLike} [dataProjection='EPSG:4326'] Default data projection.
|
||||
* @property {string} [layerName] Set the name of the TopoJSON topology
|
||||
* `objects`'s children as feature property with the specified name. This means
|
||||
* that when set to `'layer'`, a topology like
|
||||
@@ -47,7 +47,7 @@ import {get as getProjection} from '../proj.js';
|
||||
class TopoJSON extends JSONFeature {
|
||||
|
||||
/**
|
||||
* @param {module:ol/format/TopoJSON~Options=} opt_options Options.
|
||||
* @param {Options=} opt_options Options.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
super();
|
||||
@@ -91,7 +91,7 @@ class TopoJSON extends JSONFeature {
|
||||
if (transform) {
|
||||
transformArcs(arcs, scale, translate);
|
||||
}
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
/** @type {Array<import("../Feature.js").default>} */
|
||||
const features = [];
|
||||
const topoJSONFeatures = topoJSONTopology.objects;
|
||||
const property = this.layerName_;
|
||||
@@ -128,7 +128,7 @@ class TopoJSON extends JSONFeature {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, function(TopoJSONGeometry, Array, ...Array): module:ol/geom/Geometry>}
|
||||
* @type {Object<string, function(TopoJSONGeometry, Array, ...Array): import("../geom/Geometry.js").default>}
|
||||
*/
|
||||
const GEOMETRY_READERS = {
|
||||
'Point': readPointGeometry,
|
||||
@@ -144,12 +144,12 @@ const GEOMETRY_READERS = {
|
||||
* Concatenate arcs into a coordinate array.
|
||||
* @param {Array<number>} indices Indices of arcs to concatenate. Negative
|
||||
* values indicate arcs need to be reversed.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs (already
|
||||
* @param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs (already
|
||||
* transformed).
|
||||
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates array.
|
||||
* @return {Array<import("../coordinate.js").Coordinate>} Coordinates array.
|
||||
*/
|
||||
function concatenateArcs(indices, arcs) {
|
||||
/** @type {Array<module:ol/coordinate~Coordinate>} */
|
||||
/** @type {Array<import("../coordinate.js").Coordinate>} */
|
||||
const coordinates = [];
|
||||
let index, arc;
|
||||
for (let i = 0, ii = indices.length; i < ii; ++i) {
|
||||
@@ -181,7 +181,7 @@ function concatenateArcs(indices, arcs) {
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
* @return {module:ol/geom/Point} Geometry.
|
||||
* @return {import("../geom/Point.js").default} Geometry.
|
||||
*/
|
||||
function readPointGeometry(object, scale, translate) {
|
||||
const coordinates = object.coordinates;
|
||||
@@ -198,7 +198,7 @@ function readPointGeometry(object, scale, translate) {
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
* @return {module:ol/geom/MultiPoint} Geometry.
|
||||
* @return {import("../geom/MultiPoint.js").default} Geometry.
|
||||
*/
|
||||
function readMultiPointGeometry(object, scale, translate) {
|
||||
const coordinates = object.coordinates;
|
||||
@@ -215,8 +215,8 @@ function readMultiPointGeometry(object, scale, translate) {
|
||||
* Create a linestring from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @return {module:ol/geom/LineString} Geometry.
|
||||
* @param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs.
|
||||
* @return {import("../geom/LineString.js").default} Geometry.
|
||||
*/
|
||||
function readLineStringGeometry(object, arcs) {
|
||||
const coordinates = concatenateArcs(object.arcs, arcs);
|
||||
@@ -228,8 +228,8 @@ function readLineStringGeometry(object, arcs) {
|
||||
* Create a multi-linestring from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @return {module:ol/geom/MultiLineString} Geometry.
|
||||
* @param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs.
|
||||
* @return {import("../geom/MultiLineString.js").default} Geometry.
|
||||
*/
|
||||
function readMultiLineStringGeometry(object, arcs) {
|
||||
const coordinates = [];
|
||||
@@ -244,8 +244,8 @@ function readMultiLineStringGeometry(object, arcs) {
|
||||
* Create a polygon from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @return {module:ol/geom/Polygon} Geometry.
|
||||
* @param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs.
|
||||
* @return {import("../geom/Polygon.js").default} Geometry.
|
||||
*/
|
||||
function readPolygonGeometry(object, arcs) {
|
||||
const coordinates = [];
|
||||
@@ -260,8 +260,8 @@ function readPolygonGeometry(object, arcs) {
|
||||
* Create a multi-polygon from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @return {module:ol/geom/MultiPolygon} Geometry.
|
||||
* @param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs.
|
||||
* @return {import("../geom/MultiPolygon.js").default} Geometry.
|
||||
*/
|
||||
function readMultiPolygonGeometry(object, arcs) {
|
||||
const coordinates = [];
|
||||
@@ -284,14 +284,14 @@ function readMultiPolygonGeometry(object, arcs) {
|
||||
*
|
||||
* @param {TopoJSONGeometryCollection} collection TopoJSON Geometry
|
||||
* object.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
* @param {string|undefined} property Property to set the `GeometryCollection`'s parent
|
||||
* object to.
|
||||
* @param {string} name Name of the `Topology`'s child object.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {Array<module:ol/Feature>} Array of features.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @return {Array<import("../Feature.js").default>} Array of features.
|
||||
*/
|
||||
function readFeaturesFromGeometryCollection(collection, arcs, scale, translate, property, name, opt_options) {
|
||||
const geometries = collection.geometries;
|
||||
@@ -308,14 +308,14 @@ function readFeaturesFromGeometryCollection(collection, arcs, scale, translate,
|
||||
* Create a feature from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON geometry object.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
* @param {string|undefined} property Property to set the `GeometryCollection`'s parent
|
||||
* object to.
|
||||
* @param {string} name Name of the `Topology`'s child object.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {module:ol/Feature} Feature.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @return {import("../Feature.js").default} Feature.
|
||||
*/
|
||||
function readFeatureFromGeometry(object, arcs, scale, translate, property, name, opt_options) {
|
||||
let geometry;
|
||||
@@ -327,7 +327,7 @@ function readFeatureFromGeometry(object, arcs, scale, translate, property, name,
|
||||
geometry = geometryReader(object, arcs);
|
||||
}
|
||||
const feature = new Feature();
|
||||
feature.setGeometry(/** @type {module:ol/geom/Geometry} */ (
|
||||
feature.setGeometry(/** @type {import("../geom/Geometry.js").default} */ (
|
||||
transformWithOptions(geometry, false, opt_options)));
|
||||
if (object.id !== undefined) {
|
||||
feature.setId(object.id);
|
||||
@@ -350,7 +350,7 @@ function readFeatureFromGeometry(object, arcs, scale, translate, property, name,
|
||||
* Apply a linear transform to array of arcs. The provided array of arcs is
|
||||
* modified in place.
|
||||
*
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
*/
|
||||
@@ -364,7 +364,7 @@ function transformArcs(arcs, scale, translate) {
|
||||
/**
|
||||
* Apply a linear transform to an arc. The provided arc is modified in place.
|
||||
*
|
||||
* @param {Array<module:ol/coordinate~Coordinate>} arc Arc.
|
||||
* @param {Array<import("../coordinate.js").Coordinate>} arc Arc.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
*/
|
||||
@@ -386,7 +386,7 @@ function transformArc(arc, scale, translate) {
|
||||
* Apply a linear transform to a vertex. The provided vertex is modified in
|
||||
* place.
|
||||
*
|
||||
* @param {module:ol/coordinate~Coordinate} vertex Vertex.
|
||||
* @param {import("../coordinate.js").Coordinate} vertex Vertex.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,7 @@ import {createElementNS, isDocument, isNode, makeArrayPusher, makeChildAppender,
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const FEATURE_COLLECTION_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
@@ -30,7 +30,7 @@ const FEATURE_COLLECTION_PARSERS = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const TRANSACTION_SUMMARY_PARSERS = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
@@ -43,7 +43,7 @@ const TRANSACTION_SUMMARY_PARSERS = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const TRANSACTION_RESPONSE_PARSERS = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
@@ -56,7 +56,7 @@ const TRANSACTION_RESPONSE_PARSERS = {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
*/
|
||||
const QUERY_SERIALIZERS = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
@@ -66,7 +66,7 @@ const QUERY_SERIALIZERS = {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
*/
|
||||
const TRANSACTION_SERIALIZERS = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
@@ -83,7 +83,7 @@ const TRANSACTION_SERIALIZERS = {
|
||||
* @typedef {Object} Options
|
||||
* @property {Object<string, string>|string} [featureNS] The namespace URI used for features.
|
||||
* @property {Array<string>|string} [featureType] The feature type to parse. Only used for read operations.
|
||||
* @property {module:ol/format/GMLBase} [gmlFormat] The GML format to use to parse the response. Default is `ol/format/GML3`.
|
||||
* @property {import("./GMLBase.js").default} [gmlFormat] The GML format to use to parse the response. Default is `ol/format/GML3`.
|
||||
* @property {string} [schemaLocation] Optional schemaLocation to use for serialization, this will override the default.
|
||||
*/
|
||||
|
||||
@@ -105,8 +105,8 @@ const TRANSACTION_SERIALIZERS = {
|
||||
* @property {number} [count] Number of features to retrieve when paging. This is a
|
||||
* WFS 2.0 feature backported to WFS 1.1.0 by some Web Feature Services. Please note that some
|
||||
* Web Feature Services have repurposed `maxfeatures` instead.
|
||||
* @property {module:ol/extent~Extent} [bbox] Extent to use for the BBOX filter.
|
||||
* @property {module:ol/format/filter/Filter} [filter] Filter condition. See
|
||||
* @property {import("../extent.js").Extent} [bbox] Extent to use for the BBOX filter.
|
||||
* @property {import("./filter/Filter.js").default} [filter] Filter condition. See
|
||||
* {@link module:ol/format/Filter} for more information.
|
||||
* @property {string} [resultType] Indicates what response should be returned,
|
||||
* E.g. `hits` only includes the `numberOfFeatures` attribute in the response and no features.
|
||||
@@ -124,7 +124,7 @@ const TRANSACTION_SERIALIZERS = {
|
||||
* @property {boolean} [hasZ] Must be set to true if the transaction is for
|
||||
* a 3D layer. This will allow the Z coordinate to be included in the transaction.
|
||||
* @property {Array<Object>} nativeElements Native elements. Currently not supported.
|
||||
* @property {module:ol/format/GMLBase~Options} [gmlOptions] GML options for the WFS transaction writer.
|
||||
* @property {import("./GMLBase.js").Options} [gmlOptions] GML options for the WFS transaction writer.
|
||||
* @property {string} [version='1.1.0'] WFS version to use for the transaction. Can be either `1.0.0` or `1.1.0`.
|
||||
*/
|
||||
|
||||
@@ -133,7 +133,7 @@ const TRANSACTION_SERIALIZERS = {
|
||||
* Number of features; bounds/extent.
|
||||
* @typedef {Object} FeatureCollectionMetadata
|
||||
* @property {number} numberOfFeatures
|
||||
* @property {module:ol/extent~Extent} bounds
|
||||
* @property {import("../extent.js").Extent} bounds
|
||||
*/
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ const DEFAULT_VERSION = '1.1.0';
|
||||
class WFS extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {module:ol/format/WFS~Options=} opt_options Optional configuration object.
|
||||
* @param {Options=} opt_options Optional configuration object.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
super();
|
||||
@@ -226,7 +226,7 @@ class WFS extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/format/GMLBase}
|
||||
* @type {import("./GMLBase.js").default}
|
||||
*/
|
||||
this.gmlFormat_ = options.gmlFormat ?
|
||||
options.gmlFormat : new GML3();
|
||||
@@ -257,7 +257,7 @@ class WFS extends XMLFeature {
|
||||
* @inheritDoc
|
||||
*/
|
||||
readFeaturesFromNode(node, opt_options) {
|
||||
const context = /** @type {module:ol/xml~NodeStackItem} */ ({
|
||||
const context = /** @type {import("../xml.js").NodeStackItem} */ ({
|
||||
'featureType': this.featureType_,
|
||||
'featureNS': this.featureNS_
|
||||
});
|
||||
@@ -279,7 +279,7 @@ class WFS extends XMLFeature {
|
||||
* Read transaction response of the source.
|
||||
*
|
||||
* @param {Document|Element|Object|string} source Source.
|
||||
* @return {module:ol/format/WFS~TransactionResponse|undefined} Transaction response.
|
||||
* @return {TransactionResponse|undefined} Transaction response.
|
||||
* @api
|
||||
*/
|
||||
readTransactionResponse(source) {
|
||||
@@ -300,7 +300,7 @@ class WFS extends XMLFeature {
|
||||
* Read feature collection metadata of the source.
|
||||
*
|
||||
* @param {Document|Element|Object|string} source Source.
|
||||
* @return {module:ol/format/WFS~FeatureCollectionMetadata|undefined}
|
||||
* @return {FeatureCollectionMetadata|undefined}
|
||||
* FeatureCollection metadata.
|
||||
* @api
|
||||
*/
|
||||
@@ -321,7 +321,7 @@ class WFS extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Document} doc Document.
|
||||
* @return {module:ol/format/WFS~FeatureCollectionMetadata|undefined}
|
||||
* @return {FeatureCollectionMetadata|undefined}
|
||||
* FeatureCollection metadata.
|
||||
*/
|
||||
readFeatureCollectionMetadataFromDocument(doc) {
|
||||
@@ -335,7 +335,7 @@ class WFS extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @return {module:ol/format/WFS~FeatureCollectionMetadata|undefined}
|
||||
* @return {FeatureCollectionMetadata|undefined}
|
||||
* FeatureCollection metadata.
|
||||
*/
|
||||
readFeatureCollectionMetadataFromNode(node) {
|
||||
@@ -344,13 +344,13 @@ class WFS extends XMLFeature {
|
||||
node.getAttribute('numberOfFeatures'));
|
||||
result['numberOfFeatures'] = value;
|
||||
return pushParseAndPop(
|
||||
/** @type {module:ol/format/WFS~FeatureCollectionMetadata} */ (result),
|
||||
/** @type {FeatureCollectionMetadata} */ (result),
|
||||
FEATURE_COLLECTION_PARSERS, node, [], this.gmlFormat_);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Document} doc Document.
|
||||
* @return {module:ol/format/WFS~TransactionResponse|undefined} Transaction response.
|
||||
* @return {TransactionResponse|undefined} Transaction response.
|
||||
*/
|
||||
readTransactionResponseFromDocument(doc) {
|
||||
for (let n = doc.firstChild; n; n = n.nextSibling) {
|
||||
@@ -363,18 +363,18 @@ class WFS extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @return {module:ol/format/WFS~TransactionResponse|undefined} Transaction response.
|
||||
* @return {TransactionResponse|undefined} Transaction response.
|
||||
*/
|
||||
readTransactionResponseFromNode(node) {
|
||||
return pushParseAndPop(
|
||||
/** @type {module:ol/format/WFS~TransactionResponse} */({}),
|
||||
/** @type {TransactionResponse} */({}),
|
||||
TRANSACTION_RESPONSE_PARSERS, node, []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode format as WFS `GetFeature` and return the Node.
|
||||
*
|
||||
* @param {module:ol/format/WFS~WriteGetFeatureOptions} options Options.
|
||||
* @param {WriteGetFeatureOptions} options Options.
|
||||
* @return {Node} Result.
|
||||
* @api
|
||||
*/
|
||||
@@ -417,7 +417,7 @@ class WFS extends XMLFeature {
|
||||
}
|
||||
}
|
||||
node.setAttributeNS(XML_SCHEMA_INSTANCE_URI, 'xsi:schemaLocation', this.schemaLocation_);
|
||||
/** @type {module:ol/xml~NodeStackItem} */
|
||||
/** @type {import("../xml.js").NodeStackItem} */
|
||||
const context = {
|
||||
node: node,
|
||||
'srsName': options.srsName,
|
||||
@@ -436,10 +436,10 @@ class WFS extends XMLFeature {
|
||||
/**
|
||||
* Encode format as WFS `Transaction` and return the Node.
|
||||
*
|
||||
* @param {Array<module:ol/Feature>} inserts The features to insert.
|
||||
* @param {Array<module:ol/Feature>} updates The features to update.
|
||||
* @param {Array<module:ol/Feature>} deletes The features to delete.
|
||||
* @param {module:ol/format/WFS~WriteTransactionOptions} options Write options.
|
||||
* @param {Array<import("../Feature.js").default>} inserts The features to insert.
|
||||
* @param {Array<import("../Feature.js").default>} updates The features to update.
|
||||
* @param {Array<import("../Feature.js").default>} deletes The features to delete.
|
||||
* @param {WriteTransactionOptions} options Write options.
|
||||
* @return {Node} Result.
|
||||
* @api
|
||||
*/
|
||||
@@ -451,7 +451,7 @@ class WFS extends XMLFeature {
|
||||
node.setAttribute('service', 'WFS');
|
||||
node.setAttribute('version', version);
|
||||
let baseObj;
|
||||
/** @type {module:ol/xml~NodeStackItem} */
|
||||
/** @type {import("../xml.js").NodeStackItem} */
|
||||
let obj;
|
||||
if (options) {
|
||||
baseObj = options.gmlOptions ? options.gmlOptions : {};
|
||||
@@ -549,7 +549,7 @@ function readTransactionSummary(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const OGC_FID_PARSERS = {
|
||||
'http://www.opengis.net/ogc': {
|
||||
@@ -571,7 +571,7 @@ function fidParser(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const INSERT_RESULTS_PARSERS = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
@@ -593,7 +593,7 @@ function readInsertResults(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeFeature(node, feature, objectStack) {
|
||||
@@ -644,7 +644,7 @@ function getTypeName(featurePrefix, featureType) {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeDelete(node, feature, objectStack) {
|
||||
@@ -665,7 +665,7 @@ function writeDelete(node, feature, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeUpdate(node, feature, objectStack) {
|
||||
@@ -692,7 +692,7 @@ function writeUpdate(node, feature, objectStack) {
|
||||
values.push({name: name, value: value});
|
||||
}
|
||||
}
|
||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */ (
|
||||
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */ (
|
||||
{'gmlVersion': context['gmlVersion'], node: node,
|
||||
'hasZ': context['hasZ'], 'srsName': context['srsName']}),
|
||||
TRANSACTION_SERIALIZERS,
|
||||
@@ -751,7 +751,7 @@ function writeNative(node, nativeElement, objectStack) {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||
*/
|
||||
const GETFEATURE_SERIALIZERS = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
@@ -804,7 +804,7 @@ function writeQuery(node, featureType, objectStack) {
|
||||
if (featureNS) {
|
||||
node.setAttributeNS(XMLNS, 'xmlns:' + featurePrefix, featureNS);
|
||||
}
|
||||
const item = /** @type {module:ol/xml~NodeStackItem} */ (assign({}, context));
|
||||
const item = /** @type {import("../xml.js").NodeStackItem} */ (assign({}, context));
|
||||
item.node = node;
|
||||
pushSerializeAndPop(item,
|
||||
QUERY_SERIALIZERS,
|
||||
@@ -821,11 +821,11 @@ function writeQuery(node, featureType, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/Filter} filter Filter.
|
||||
* @param {import("./filter/Filter.js").default} filter Filter.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeFilterCondition(node, filter, objectStack) {
|
||||
/** @type {module:ol/xml~NodeStackItem} */
|
||||
/** @type {import("../xml.js").NodeStackItem} */
|
||||
const item = {node: node};
|
||||
pushSerializeAndPop(item,
|
||||
GETFEATURE_SERIALIZERS,
|
||||
@@ -836,7 +836,7 @@ function writeFilterCondition(node, filter, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/Bbox} filter Filter.
|
||||
* @param {import("./filter/Bbox.js").default} filter Filter.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeBboxFilter(node, filter, objectStack) {
|
||||
@@ -850,7 +850,7 @@ function writeBboxFilter(node, filter, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/Contains} filter Filter.
|
||||
* @param {import("./filter/Contains.js").default} filter Filter.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeContainsFilter(node, filter, objectStack) {
|
||||
@@ -864,7 +864,7 @@ function writeContainsFilter(node, filter, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/Intersects} filter Filter.
|
||||
* @param {import("./filter/Intersects.js").default} filter Filter.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeIntersectsFilter(node, filter, objectStack) {
|
||||
@@ -878,7 +878,7 @@ function writeIntersectsFilter(node, filter, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/Within} filter Filter.
|
||||
* @param {import("./filter/Within.js").default} filter Filter.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeWithinFilter(node, filter, objectStack) {
|
||||
@@ -892,7 +892,7 @@ function writeWithinFilter(node, filter, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/During} filter Filter.
|
||||
* @param {import("./filter/During.js").default} filter Filter.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeDuringFilter(node, filter, objectStack) {
|
||||
@@ -917,11 +917,11 @@ function writeDuringFilter(node, filter, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/LogicalNary} filter Filter.
|
||||
* @param {import("./filter/LogicalNary.js").default} filter Filter.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeLogicalFilter(node, filter, objectStack) {
|
||||
/** @type {module:ol/xml~NodeStackItem} */
|
||||
/** @type {import("../xml.js").NodeStackItem} */
|
||||
const item = {node: node};
|
||||
const conditions = filter.conditions;
|
||||
for (let i = 0, ii = conditions.length; i < ii; ++i) {
|
||||
@@ -936,11 +936,11 @@ function writeLogicalFilter(node, filter, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/Not} filter Filter.
|
||||
* @param {import("./filter/Not.js").default} filter Filter.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeNotFilter(node, filter, objectStack) {
|
||||
/** @type {module:ol/xml~NodeStackItem} */
|
||||
/** @type {import("../xml.js").NodeStackItem} */
|
||||
const item = {node: node};
|
||||
const condition = filter.condition;
|
||||
pushSerializeAndPop(item,
|
||||
@@ -952,7 +952,7 @@ function writeNotFilter(node, filter, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/format/filter/ComparisonBinary} filter Filter.
|
||||
* @param {import("./filter/ComparisonBinary.js").default} filter Filter.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeComparisonFilter(node, filter, objectStack) {
|
||||
@@ -966,7 +966,7 @@ function writeComparisonFilter(node, filter, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/IsNull} filter Filter.
|
||||
* @param {import("./filter/IsNull.js").default} filter Filter.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeIsNullFilter(node, filter, objectStack) {
|
||||
@@ -976,7 +976,7 @@ function writeIsNullFilter(node, filter, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/IsBetween} filter Filter.
|
||||
* @param {import("./filter/IsBetween.js").default} filter Filter.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeIsBetweenFilter(node, filter, objectStack) {
|
||||
@@ -994,7 +994,7 @@ function writeIsBetweenFilter(node, filter, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {module:ol/format/filter/IsLike} filter Filter.
|
||||
* @param {import("./filter/IsLike.js").default} filter Filter.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeIsLikeFilter(node, filter, objectStack) {
|
||||
@@ -1056,7 +1056,7 @@ function writeTimeInstant(node, time) {
|
||||
/**
|
||||
* Encode filter as WFS `Filter` and return the Node.
|
||||
*
|
||||
* @param {module:ol/format/filter/Filter} filter Filter.
|
||||
* @param {import("./filter/Filter.js").default} filter Filter.
|
||||
* @return {Node} Result.
|
||||
* @api
|
||||
*/
|
||||
@@ -1074,7 +1074,7 @@ export function writeFilter(filter) {
|
||||
*/
|
||||
function writeGetFeature(node, featureTypes, objectStack) {
|
||||
const context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
const item = /** @type {module:ol/xml~NodeStackItem} */ (assign({}, context));
|
||||
const item = /** @type {import("../xml.js").NodeStackItem} */ (assign({}, context));
|
||||
item.node = node;
|
||||
pushSerializeAndPop(item,
|
||||
GETFEATURE_SERIALIZERS,
|
||||
|
||||
@@ -17,7 +17,7 @@ import SimpleGeometry from '../geom/SimpleGeometry.js';
|
||||
|
||||
|
||||
/**
|
||||
* @enum {function (new:module:ol/geom/Geometry, Array, module:ol/geom/GeometryLayout)}
|
||||
* @enum {function (new:import("../geom/Geometry.js").default, Array, import("../geom/GeometryLayout.js").default)}
|
||||
*/
|
||||
const GeometryConstructor = {
|
||||
'POINT': Point,
|
||||
@@ -155,7 +155,7 @@ class Lexer {
|
||||
|
||||
/**
|
||||
* Fetch and return the next token.
|
||||
* @return {!module:ol/format/WKT~Token} Next string token.
|
||||
* @return {!Token} Next string token.
|
||||
*/
|
||||
nextToken() {
|
||||
const c = this.nextChar_();
|
||||
@@ -232,24 +232,24 @@ class Lexer {
|
||||
class Parser {
|
||||
|
||||
/**
|
||||
* @param {module:ol/format/WKT~Lexer} lexer The lexer.
|
||||
* @param {Lexer} lexer The lexer.
|
||||
*/
|
||||
constructor(lexer) {
|
||||
|
||||
/**
|
||||
* @type {module:ol/format/WKT~Lexer}
|
||||
* @type {Lexer}
|
||||
* @private
|
||||
*/
|
||||
this.lexer_ = lexer;
|
||||
|
||||
/**
|
||||
* @type {module:ol/format/WKT~Token}
|
||||
* @type {Token}
|
||||
* @private
|
||||
*/
|
||||
this.token_;
|
||||
|
||||
/**
|
||||
* @type {module:ol/geom/GeometryLayout}
|
||||
* @type {import("../geom/GeometryLayout.js").default}
|
||||
* @private
|
||||
*/
|
||||
this.layout_ = GeometryLayout.XY;
|
||||
@@ -265,7 +265,7 @@ class Parser {
|
||||
|
||||
/**
|
||||
* Tests if the given type matches the type of the current token.
|
||||
* @param {module:ol/format/WKT~TokenType} type Token type.
|
||||
* @param {TokenType} type Token type.
|
||||
* @return {boolean} Whether the token matches the given type.
|
||||
*/
|
||||
isTokenType(type) {
|
||||
@@ -275,7 +275,7 @@ class Parser {
|
||||
|
||||
/**
|
||||
* If the given type matches the current token, consume it.
|
||||
* @param {module:ol/format/WKT~TokenType} type Token type.
|
||||
* @param {TokenType} type Token type.
|
||||
* @return {boolean} Whether the token matches the given type.
|
||||
*/
|
||||
match(type) {
|
||||
@@ -288,7 +288,7 @@ class Parser {
|
||||
|
||||
/**
|
||||
* Try to parse the tokens provided by the lexer.
|
||||
* @return {module:ol/geom/Geometry} The geometry.
|
||||
* @return {import("../geom/Geometry.js").default} The geometry.
|
||||
*/
|
||||
parse() {
|
||||
this.consume_();
|
||||
@@ -298,7 +298,7 @@ class Parser {
|
||||
|
||||
/**
|
||||
* Try to parse the dimensional info.
|
||||
* @return {module:ol/geom/GeometryLayout} The layout.
|
||||
* @return {import("../geom/GeometryLayout.js").default} The layout.
|
||||
* @private
|
||||
*/
|
||||
parseGeometryLayout_() {
|
||||
@@ -321,7 +321,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array<module:ol/geom/Geometry>} A collection of geometries.
|
||||
* @return {!Array<import("../geom/Geometry.js").default>} A collection of geometries.
|
||||
* @private
|
||||
*/
|
||||
parseGeometryCollectionText_() {
|
||||
@@ -534,7 +534,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!module:ol/geom/Geometry} The geometry.
|
||||
* @return {!import("../geom/Geometry.js").default} The geometry.
|
||||
* @private
|
||||
*/
|
||||
parseGeometry_() {
|
||||
@@ -607,7 +607,7 @@ class Parser {
|
||||
class WKT extends TextFeature {
|
||||
|
||||
/**
|
||||
* @param {module:ol/format/WKT~Options=} opt_options Options.
|
||||
* @param {Options=} opt_options Options.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
super();
|
||||
@@ -628,7 +628,7 @@ class WKT extends TextFeature {
|
||||
/**
|
||||
* Parse a WKT string.
|
||||
* @param {string} wkt WKT string.
|
||||
* @return {module:ol/geom/Geometry|undefined}
|
||||
* @return {import("../geom/Geometry.js").default|undefined}
|
||||
* The geometry created.
|
||||
* @private
|
||||
*/
|
||||
@@ -659,7 +659,7 @@ class WKT extends TextFeature {
|
||||
const geometry = this.readGeometryFromText(text, opt_options);
|
||||
if (this.splitCollection_ &&
|
||||
geometry.getType() == GeometryType.GEOMETRY_COLLECTION) {
|
||||
geometries = (/** @type {module:ol/geom/GeometryCollection} */ (geometry))
|
||||
geometries = (/** @type {import("../geom/GeometryCollection.js").default} */ (geometry))
|
||||
.getGeometriesArray();
|
||||
} else {
|
||||
geometries = [geometry];
|
||||
@@ -680,7 +680,7 @@ class WKT extends TextFeature {
|
||||
const geometry = this.parse_(text);
|
||||
if (geometry) {
|
||||
return (
|
||||
/** @type {module:ol/geom/Geometry} */ (transformWithOptions(geometry, false, opt_options))
|
||||
/** @type {import("../geom/Geometry.js").default} */ (transformWithOptions(geometry, false, opt_options))
|
||||
);
|
||||
} else {
|
||||
return null;
|
||||
@@ -717,14 +717,14 @@ class WKT extends TextFeature {
|
||||
* @inheritDoc
|
||||
*/
|
||||
writeGeometryText(geometry, opt_options) {
|
||||
return encode(/** @type {module:ol/geom/Geometry} */ (
|
||||
return encode(/** @type {import("../geom/Geometry.js").default} */ (
|
||||
transformWithOptions(geometry, true, opt_options)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Point} geom Point geometry.
|
||||
* @param {import("../geom/Point.js").default} geom Point geometry.
|
||||
* @return {string} Coordinates part of Point as WKT.
|
||||
*/
|
||||
function encodePointGeometry(geom) {
|
||||
@@ -737,7 +737,7 @@ function encodePointGeometry(geom) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/MultiPoint} geom MultiPoint geometry.
|
||||
* @param {import("../geom/MultiPoint.js").default} geom MultiPoint geometry.
|
||||
* @return {string} Coordinates part of MultiPoint as WKT.
|
||||
*/
|
||||
function encodeMultiPointGeometry(geom) {
|
||||
@@ -751,7 +751,7 @@ function encodeMultiPointGeometry(geom) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/GeometryCollection} geom GeometryCollection geometry.
|
||||
* @param {import("../geom/GeometryCollection.js").default} geom GeometryCollection geometry.
|
||||
* @return {string} Coordinates part of GeometryCollection as WKT.
|
||||
*/
|
||||
function encodeGeometryCollectionGeometry(geom) {
|
||||
@@ -765,7 +765,7 @@ function encodeGeometryCollectionGeometry(geom) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/LineString|module:ol/geom/LinearRing} geom LineString geometry.
|
||||
* @param {import("../geom/LineString.js").default|import("../geom/LinearRing.js").default} geom LineString geometry.
|
||||
* @return {string} Coordinates part of LineString as WKT.
|
||||
*/
|
||||
function encodeLineStringGeometry(geom) {
|
||||
@@ -779,7 +779,7 @@ function encodeLineStringGeometry(geom) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/MultiLineString} geom MultiLineString geometry.
|
||||
* @param {import("../geom/MultiLineString.js").default} geom MultiLineString geometry.
|
||||
* @return {string} Coordinates part of MultiLineString as WKT.
|
||||
*/
|
||||
function encodeMultiLineStringGeometry(geom) {
|
||||
@@ -793,7 +793,7 @@ function encodeMultiLineStringGeometry(geom) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Polygon} geom Polygon geometry.
|
||||
* @param {import("../geom/Polygon.js").default} geom Polygon geometry.
|
||||
* @return {string} Coordinates part of Polygon as WKT.
|
||||
*/
|
||||
function encodePolygonGeometry(geom) {
|
||||
@@ -807,7 +807,7 @@ function encodePolygonGeometry(geom) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/MultiPolygon} geom MultiPolygon geometry.
|
||||
* @param {import("../geom/MultiPolygon.js").default} geom MultiPolygon geometry.
|
||||
* @return {string} Coordinates part of MultiPolygon as WKT.
|
||||
*/
|
||||
function encodeMultiPolygonGeometry(geom) {
|
||||
@@ -820,7 +820,7 @@ function encodeMultiPolygonGeometry(geom) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/SimpleGeometry} geom SimpleGeometry geometry.
|
||||
* @param {import("../geom/SimpleGeometry.js").default} geom SimpleGeometry geometry.
|
||||
* @return {string} Potential dimensional information for WKT type.
|
||||
*/
|
||||
function encodeGeometryLayout(geom) {
|
||||
@@ -838,7 +838,7 @@ function encodeGeometryLayout(geom) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, function(module:ol/geom/Geometry): string>}
|
||||
* @type {Object<string, function(import("../geom/Geometry.js").default): string>}
|
||||
*/
|
||||
const GeometryEncoder = {
|
||||
'Point': encodePointGeometry,
|
||||
@@ -853,7 +853,7 @@ const GeometryEncoder = {
|
||||
|
||||
/**
|
||||
* Encode a geometry as WKT.
|
||||
* @param {module:ol/geom/Geometry} geom The geometry to encode.
|
||||
* @param {import("../geom/Geometry.js").default} geom The geometry to encode.
|
||||
* @return {string} WKT string for the geometry.
|
||||
*/
|
||||
function encode(geom) {
|
||||
|
||||
@@ -20,7 +20,7 @@ const NAMESPACE_URIS = [
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -31,7 +31,7 @@ const PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const CAPABILITY_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -84,7 +84,7 @@ class WMSCapabilities extends XML {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const SERVICE_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -104,7 +104,7 @@ const SERVICE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const CONTACT_INFORMATION_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -119,7 +119,7 @@ const CONTACT_INFORMATION_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const CONTACT_PERSON_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -130,7 +130,7 @@ const CONTACT_PERSON_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const CONTACT_ADDRESS_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -145,7 +145,7 @@ const CONTACT_ADDRESS_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const EXCEPTION_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -155,7 +155,7 @@ const EXCEPTION_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const LAYER_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -182,7 +182,7 @@ const LAYER_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const ATTRIBUTION_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -194,7 +194,7 @@ const ATTRIBUTION_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS =
|
||||
makeStructureNS(NAMESPACE_URIS, {
|
||||
@@ -207,7 +207,7 @@ const EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS =
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const REQUEST_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -219,7 +219,7 @@ const REQUEST_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const OPERATIONTYPE_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -230,7 +230,7 @@ const OPERATIONTYPE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const DCPTYPE_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -240,7 +240,7 @@ const DCPTYPE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const HTTP_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -251,7 +251,7 @@ const HTTP_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const STYLE_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -266,7 +266,7 @@ const STYLE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const FORMAT_ONLINERESOURCE_PARSERS =
|
||||
makeStructureNS(NAMESPACE_URIS, {
|
||||
@@ -277,7 +277,7 @@ const FORMAT_ONLINERESOURCE_PARSERS =
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const KEYWORDLIST_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -324,7 +324,7 @@ function readBoundingBox(node, objectStack) {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/extent~Extent|undefined} Bounding box object.
|
||||
* @return {import("../extent.js").Extent|undefined} Bounding box object.
|
||||
*/
|
||||
function readEXGeographicBoundingBox(node, objectStack) {
|
||||
const geographicBoundingBox = pushParseAndPop(
|
||||
|
||||
@@ -38,7 +38,7 @@ const layerIdentifier = '_layer';
|
||||
class WMSGetFeatureInfo extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {module:ol/format/WMSGetFeatureInfo~Options=} opt_options Options.
|
||||
* @param {Options=} opt_options Options.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
super();
|
||||
@@ -54,7 +54,7 @@ class WMSGetFeatureInfo extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/format/GML2}
|
||||
* @type {import("./GML2.js").default}
|
||||
*/
|
||||
this.gmlFormat_ = new GML2();
|
||||
|
||||
@@ -83,13 +83,13 @@ class WMSGetFeatureInfo extends XMLFeature {
|
||||
/**
|
||||
* @param {Element} node Node.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @return {Array<import("../Feature.js").default>} Features.
|
||||
* @private
|
||||
*/
|
||||
readFeatures_(node, objectStack) {
|
||||
node.setAttribute('namespaceURI', this.featureNS_);
|
||||
const localName = node.localName;
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
/** @type {Array<import("../Feature.js").default>} */
|
||||
let features = [];
|
||||
if (node.childNodes.length === 0) {
|
||||
return features;
|
||||
|
||||
@@ -32,7 +32,7 @@ const OWS_NAMESPACE_URIS = [
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -51,7 +51,7 @@ class WMTSCapabilities extends XML {
|
||||
super();
|
||||
|
||||
/**
|
||||
* @type {module:ol/format/OWS}
|
||||
* @type {import("./OWS.js").default}
|
||||
* @private
|
||||
*/
|
||||
this.owsParser_ = new OWS();
|
||||
@@ -87,7 +87,7 @@ class WMTSCapabilities extends XML {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const CONTENTS_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -98,7 +98,7 @@ const CONTENTS_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const LAYER_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -117,7 +117,7 @@ const LAYER_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const STYLE_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -130,7 +130,7 @@ const STYLE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const TMS_LINKS_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -140,7 +140,7 @@ const TMS_LINKS_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const TMS_LIMITS_LIST_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -150,7 +150,7 @@ const TMS_LIMITS_LIST_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const TMS_LIMITS_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -164,7 +164,7 @@ const TMS_LIMITS_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const DIMENSION_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -177,7 +177,7 @@ const DIMENSION_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const WGS84_BBOX_READERS = makeStructureNS(
|
||||
OWS_NAMESPACE_URIS, {
|
||||
@@ -188,7 +188,7 @@ const WGS84_BBOX_READERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const TMS_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -202,7 +202,7 @@ const TMS_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||
*/
|
||||
const TM_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
|
||||
@@ -36,8 +36,8 @@ class XMLFeature extends FeatureFormat {
|
||||
* Read a single feature.
|
||||
*
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {module:ol/Feature} Feature.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||
* @return {import("../Feature.js").default} Feature.
|
||||
* @api
|
||||
*/
|
||||
readFeature(source, opt_options) {
|
||||
@@ -55,8 +55,8 @@ class XMLFeature extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @param {Document} doc Document.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||
* @return {module:ol/Feature} Feature.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||
* @return {import("../Feature.js").default} Feature.
|
||||
*/
|
||||
readFeatureFromDocument(doc, opt_options) {
|
||||
const features = this.readFeaturesFromDocument(doc, opt_options);
|
||||
@@ -69,8 +69,8 @@ class XMLFeature extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||
* @return {module:ol/Feature} Feature.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||
* @return {import("../Feature.js").default} Feature.
|
||||
*/
|
||||
readFeatureFromNode(node, opt_options) {
|
||||
return null; // not implemented
|
||||
@@ -81,8 +81,8 @@ class XMLFeature extends FeatureFormat {
|
||||
*
|
||||
* @function
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||
* @return {Array<import("../Feature.js").default>} Features.
|
||||
* @api
|
||||
*/
|
||||
readFeatures(source, opt_options) {
|
||||
@@ -101,12 +101,12 @@ class XMLFeature extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @param {Document} doc Document.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||
* @protected
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @return {Array<import("../Feature.js").default>} Features.
|
||||
*/
|
||||
readFeaturesFromDocument(doc, opt_options) {
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
/** @type {Array<import("../Feature.js").default>} */
|
||||
const features = [];
|
||||
for (let n = doc.firstChild; n; n = n.nextSibling) {
|
||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||
@@ -119,9 +119,9 @@ class XMLFeature extends FeatureFormat {
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||
* @protected
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @return {Array<import("../Feature.js").default>} Features.
|
||||
*/
|
||||
readFeaturesFromNode(node, opt_options) {}
|
||||
|
||||
@@ -144,9 +144,9 @@ class XMLFeature extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @param {Document} doc Document.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||
* @protected
|
||||
* @return {module:ol/geom/Geometry} Geometry.
|
||||
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||
*/
|
||||
readGeometryFromDocument(doc, opt_options) {
|
||||
return null; // not implemented
|
||||
@@ -154,9 +154,9 @@ class XMLFeature extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||
* @protected
|
||||
* @return {module:ol/geom/Geometry} Geometry.
|
||||
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||
*/
|
||||
readGeometryFromNode(node, opt_options) {
|
||||
return null; // not implemented
|
||||
@@ -166,7 +166,7 @@ class XMLFeature extends FeatureFormat {
|
||||
* Read the projection from the source.
|
||||
*
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @return {module:ol/proj/Projection} Projection.
|
||||
* @return {import("../proj/Projection.js").default} Projection.
|
||||
* @api
|
||||
*/
|
||||
readProjection(source) {
|
||||
@@ -185,7 +185,7 @@ class XMLFeature extends FeatureFormat {
|
||||
/**
|
||||
* @param {Document} doc Document.
|
||||
* @protected
|
||||
* @return {module:ol/proj/Projection} Projection.
|
||||
* @return {import("../proj/Projection.js").default} Projection.
|
||||
*/
|
||||
readProjectionFromDocument(doc) {
|
||||
return this.dataProjection;
|
||||
@@ -194,7 +194,7 @@ class XMLFeature extends FeatureFormat {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @protected
|
||||
* @return {module:ol/proj/Projection} Projection.
|
||||
* @return {import("../proj/Projection.js").default} Projection.
|
||||
*/
|
||||
readProjectionFromNode(node) {
|
||||
return this.dataProjection;
|
||||
@@ -209,8 +209,8 @@ class XMLFeature extends FeatureFormat {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||
* @protected
|
||||
* @return {Node} Node.
|
||||
*/
|
||||
@@ -221,8 +221,8 @@ class XMLFeature extends FeatureFormat {
|
||||
/**
|
||||
* Encode an array of features as string.
|
||||
*
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @param {Array<import("../Feature.js").default>} features Features.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||
* @return {string} Result.
|
||||
* @api
|
||||
*/
|
||||
@@ -232,8 +232,8 @@ class XMLFeature extends FeatureFormat {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @param {Array<import("../Feature.js").default>} features Features.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||
* @return {Node} Node.
|
||||
*/
|
||||
writeFeaturesNode(features, opt_options) {
|
||||
@@ -249,8 +249,8 @@ class XMLFeature extends FeatureFormat {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||
* @return {Node} Node.
|
||||
*/
|
||||
writeGeometryNode(geometry, opt_options) {
|
||||
|
||||
@@ -23,8 +23,8 @@ import Within from '../format/filter/Within.js';
|
||||
/**
|
||||
* Create a logical `<And>` operator between two or more filter conditions.
|
||||
*
|
||||
* @param {...module:ol/format/filter/Filter} conditions Filter conditions.
|
||||
* @returns {!module:ol/format/filter/And} `<And>` operator.
|
||||
* @param {...import("./filter/Filter.js").default} conditions Filter conditions.
|
||||
* @returns {!import("./filter/And.js").default} `<And>` operator.
|
||||
* @api
|
||||
*/
|
||||
export function and(conditions) {
|
||||
@@ -36,8 +36,8 @@ export function and(conditions) {
|
||||
/**
|
||||
* Create a logical `<Or>` operator between two or more filter conditions.
|
||||
*
|
||||
* @param {...module:ol/format/filter/Filter} conditions Filter conditions.
|
||||
* @returns {!module:ol/format/filter/Or} `<Or>` operator.
|
||||
* @param {...import("./filter/Filter.js").default} conditions Filter conditions.
|
||||
* @returns {!import("./filter/Or.js").default} `<Or>` operator.
|
||||
* @api
|
||||
*/
|
||||
export function or(conditions) {
|
||||
@@ -49,8 +49,8 @@ export function or(conditions) {
|
||||
/**
|
||||
* Represents a logical `<Not>` operator for a filter condition.
|
||||
*
|
||||
* @param {!module:ol/format/filter/Filter} condition Filter condition.
|
||||
* @returns {!module:ol/format/filter/Not} `<Not>` operator.
|
||||
* @param {!import("./filter/Filter.js").default} condition Filter condition.
|
||||
* @returns {!import("./filter/Not.js").default} `<Not>` operator.
|
||||
* @api
|
||||
*/
|
||||
export function not(condition) {
|
||||
@@ -63,10 +63,10 @@ export function not(condition) {
|
||||
* intersects a fixed bounding box
|
||||
*
|
||||
* @param {!string} geometryName Geometry name to use.
|
||||
* @param {!module:ol/extent~Extent} extent Extent.
|
||||
* @param {!import("../extent.js").Extent} extent Extent.
|
||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||
* set on geometries when this is not provided.
|
||||
* @returns {!module:ol/format/filter/Bbox} `<BBOX>` operator.
|
||||
* @returns {!import("./filter/Bbox.js").default} `<BBOX>` operator.
|
||||
* @api
|
||||
*/
|
||||
export function bbox(geometryName, extent, opt_srsName) {
|
||||
@@ -78,10 +78,10 @@ export function bbox(geometryName, extent, opt_srsName) {
|
||||
* contains a given geometry.
|
||||
*
|
||||
* @param {!string} geometryName Geometry name to use.
|
||||
* @param {!module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {!import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||
* set on geometries when this is not provided.
|
||||
* @returns {!module:ol/format/filter/Contains} `<Contains>` operator.
|
||||
* @returns {!import("./filter/Contains.js").default} `<Contains>` operator.
|
||||
* @api
|
||||
*/
|
||||
export function contains(geometryName, geometry, opt_srsName) {
|
||||
@@ -93,10 +93,10 @@ export function contains(geometryName, geometry, opt_srsName) {
|
||||
* intersects a given geometry.
|
||||
*
|
||||
* @param {!string} geometryName Geometry name to use.
|
||||
* @param {!module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {!import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||
* set on geometries when this is not provided.
|
||||
* @returns {!module:ol/format/filter/Intersects} `<Intersects>` operator.
|
||||
* @returns {!import("./filter/Intersects.js").default} `<Intersects>` operator.
|
||||
* @api
|
||||
*/
|
||||
export function intersects(geometryName, geometry, opt_srsName) {
|
||||
@@ -108,10 +108,10 @@ export function intersects(geometryName, geometry, opt_srsName) {
|
||||
* is within a given geometry.
|
||||
*
|
||||
* @param {!string} geometryName Geometry name to use.
|
||||
* @param {!module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {!import("../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||
* set on geometries when this is not provided.
|
||||
* @returns {!module:ol/format/filter/Within} `<Within>` operator.
|
||||
* @returns {!import("./filter/Within.js").default} `<Within>` operator.
|
||||
* @api
|
||||
*/
|
||||
export function within(geometryName, geometry, opt_srsName) {
|
||||
@@ -125,7 +125,7 @@ export function within(geometryName, geometry, opt_srsName) {
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!(string|number)} expression The value to compare.
|
||||
* @param {boolean=} opt_matchCase Case-sensitive?
|
||||
* @returns {!module:ol/format/filter/EqualTo} `<PropertyIsEqualTo>` operator.
|
||||
* @returns {!import("./filter/EqualTo.js").default} `<PropertyIsEqualTo>` operator.
|
||||
* @api
|
||||
*/
|
||||
export function equalTo(propertyName, expression, opt_matchCase) {
|
||||
@@ -139,7 +139,7 @@ export function equalTo(propertyName, expression, opt_matchCase) {
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!(string|number)} expression The value to compare.
|
||||
* @param {boolean=} opt_matchCase Case-sensitive?
|
||||
* @returns {!module:ol/format/filter/NotEqualTo} `<PropertyIsNotEqualTo>` operator.
|
||||
* @returns {!import("./filter/NotEqualTo.js").default} `<PropertyIsNotEqualTo>` operator.
|
||||
* @api
|
||||
*/
|
||||
export function notEqualTo(propertyName, expression, opt_matchCase) {
|
||||
@@ -152,7 +152,7 @@ export function notEqualTo(propertyName, expression, opt_matchCase) {
|
||||
*
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!number} expression The value to compare.
|
||||
* @returns {!module:ol/format/filter/LessThan} `<PropertyIsLessThan>` operator.
|
||||
* @returns {!import("./filter/LessThan.js").default} `<PropertyIsLessThan>` operator.
|
||||
* @api
|
||||
*/
|
||||
export function lessThan(propertyName, expression) {
|
||||
@@ -165,7 +165,7 @@ export function lessThan(propertyName, expression) {
|
||||
*
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!number} expression The value to compare.
|
||||
* @returns {!module:ol/format/filter/LessThanOrEqualTo} `<PropertyIsLessThanOrEqualTo>` operator.
|
||||
* @returns {!import("./filter/LessThanOrEqualTo.js").default} `<PropertyIsLessThanOrEqualTo>` operator.
|
||||
* @api
|
||||
*/
|
||||
export function lessThanOrEqualTo(propertyName, expression) {
|
||||
@@ -178,7 +178,7 @@ export function lessThanOrEqualTo(propertyName, expression) {
|
||||
*
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!number} expression The value to compare.
|
||||
* @returns {!module:ol/format/filter/GreaterThan} `<PropertyIsGreaterThan>` operator.
|
||||
* @returns {!import("./filter/GreaterThan.js").default} `<PropertyIsGreaterThan>` operator.
|
||||
* @api
|
||||
*/
|
||||
export function greaterThan(propertyName, expression) {
|
||||
@@ -191,7 +191,7 @@ export function greaterThan(propertyName, expression) {
|
||||
*
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!number} expression The value to compare.
|
||||
* @returns {!module:ol/format/filter/GreaterThanOrEqualTo} `<PropertyIsGreaterThanOrEqualTo>` operator.
|
||||
* @returns {!import("./filter/GreaterThanOrEqualTo.js").default} `<PropertyIsGreaterThanOrEqualTo>` operator.
|
||||
* @api
|
||||
*/
|
||||
export function greaterThanOrEqualTo(propertyName, expression) {
|
||||
@@ -204,7 +204,7 @@ export function greaterThanOrEqualTo(propertyName, expression) {
|
||||
* is null.
|
||||
*
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @returns {!module:ol/format/filter/IsNull} `<PropertyIsNull>` operator.
|
||||
* @returns {!import("./filter/IsNull.js").default} `<PropertyIsNull>` operator.
|
||||
* @api
|
||||
*/
|
||||
export function isNull(propertyName) {
|
||||
@@ -219,7 +219,7 @@ export function isNull(propertyName) {
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!number} lowerBoundary The lower bound of the range.
|
||||
* @param {!number} upperBoundary The upper bound of the range.
|
||||
* @returns {!module:ol/format/filter/IsBetween} `<PropertyIsBetween>` operator.
|
||||
* @returns {!import("./filter/IsBetween.js").default} `<PropertyIsBetween>` operator.
|
||||
* @api
|
||||
*/
|
||||
export function between(propertyName, lowerBoundary, upperBoundary) {
|
||||
@@ -240,7 +240,7 @@ export function between(propertyName, lowerBoundary, upperBoundary) {
|
||||
* @param {string=} opt_escapeChar Escape character which can be used to escape
|
||||
* the pattern characters. Default is '!'.
|
||||
* @param {boolean=} opt_matchCase Case-sensitive?
|
||||
* @returns {!module:ol/format/filter/IsLike} `<PropertyIsLike>` operator.
|
||||
* @returns {!import("./filter/IsLike.js").default} `<PropertyIsLike>` operator.
|
||||
* @api
|
||||
*/
|
||||
export function like(propertyName, pattern,
|
||||
@@ -256,7 +256,7 @@ export function like(propertyName, pattern,
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!string} begin The begin date in ISO-8601 format.
|
||||
* @param {!string} end The end date in ISO-8601 format.
|
||||
* @returns {!module:ol/format/filter/During} `<During>` operator.
|
||||
* @returns {!import("./filter/During.js").default} `<During>` operator.
|
||||
* @api
|
||||
*/
|
||||
export function during(propertyName, begin, end) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import LogicalNary from '../filter/LogicalNary.js';
|
||||
class And extends LogicalNary {
|
||||
|
||||
/**
|
||||
* @param {...module:ol/format/filter/Filter} conditions Conditions.
|
||||
* @param {...import("./Filter.js").default} conditions Conditions.
|
||||
*/
|
||||
constructor(conditions) {
|
||||
const params = ['And'].concat(Array.prototype.slice.call(arguments));
|
||||
|
||||
@@ -14,7 +14,7 @@ class Bbox extends Filter {
|
||||
|
||||
/**
|
||||
* @param {!string} geometryName Geometry name to use.
|
||||
* @param {!module:ol/extent~Extent} extent Extent.
|
||||
* @param {!import("../../extent.js").Extent} extent Extent.
|
||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be set
|
||||
* on geometries when this is not provided.
|
||||
*/
|
||||
@@ -28,7 +28,7 @@ class Bbox extends Filter {
|
||||
this.geometryName = geometryName;
|
||||
|
||||
/**
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("../../extent.js").Extent}
|
||||
*/
|
||||
this.extent = extent;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class Contains extends Spatial {
|
||||
|
||||
/**
|
||||
* @param {!string} geometryName Geometry name to use.
|
||||
* @param {!module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {!import("../../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||
* set on geometries when this is not provided.
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,7 @@ class Intersects extends Spatial {
|
||||
|
||||
/**
|
||||
* @param {!string} geometryName Geometry name to use.
|
||||
* @param {!module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {!import("../../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||
* set on geometries when this is not provided.
|
||||
*/
|
||||
|
||||
@@ -15,14 +15,14 @@ class LogicalNary extends Filter {
|
||||
|
||||
/**
|
||||
* @param {!string} tagName The XML tag name for this filter.
|
||||
* @param {...module:ol/format/filter/Filter} conditions Conditions.
|
||||
* @param {...import("./Filter.js").default} conditions Conditions.
|
||||
*/
|
||||
constructor(tagName, conditions) {
|
||||
|
||||
super(tagName);
|
||||
|
||||
/**
|
||||
* @type {Array<module:ol/format/filter/Filter>}
|
||||
* @type {Array<import("./Filter.js").default>}
|
||||
*/
|
||||
this.conditions = Array.prototype.slice.call(arguments, 1);
|
||||
assert(this.conditions.length >= 2, 57); // At least 2 conditions are required.
|
||||
|
||||
@@ -11,14 +11,14 @@ import Filter from '../filter/Filter.js';
|
||||
class Not extends Filter {
|
||||
|
||||
/**
|
||||
* @param {!module:ol/format/filter/Filter} condition Filter condition.
|
||||
* @param {!import("./Filter.js").default} condition Filter condition.
|
||||
*/
|
||||
constructor(condition) {
|
||||
|
||||
super('Not');
|
||||
|
||||
/**
|
||||
* @type {!module:ol/format/filter/Filter}
|
||||
* @type {!import("./Filter.js").default}
|
||||
*/
|
||||
this.condition = condition;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import LogicalNary from '../filter/LogicalNary.js';
|
||||
class Or extends LogicalNary {
|
||||
|
||||
/**
|
||||
* @param {...module:ol/format/filter/Filter} conditions Conditions.
|
||||
* @param {...import("./Filter.js").default} conditions Conditions.
|
||||
*/
|
||||
constructor(conditions) {
|
||||
const params = ['Or'].concat(Array.prototype.slice.call(arguments));
|
||||
|
||||
@@ -16,7 +16,7 @@ class Spatial extends Filter {
|
||||
/**
|
||||
* @param {!string} tagName The XML tag name for this filter.
|
||||
* @param {!string} geometryName Geometry name to use.
|
||||
* @param {!module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {!import("../../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||
* set on geometries when this is not provided.
|
||||
*/
|
||||
@@ -30,7 +30,7 @@ class Spatial extends Filter {
|
||||
this.geometryName = geometryName || 'the_geom';
|
||||
|
||||
/**
|
||||
* @type {module:ol/geom/Geometry}
|
||||
* @type {import("../../geom/Geometry.js").default}
|
||||
*/
|
||||
this.geometry = geometry;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class Within extends Spatial {
|
||||
|
||||
/**
|
||||
* @param {!string} geometryName Geometry name to use.
|
||||
* @param {!module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {!import("../../geom/Geometry.js").default} geometry Geometry.
|
||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||
* set on geometries when this is not provided.
|
||||
*/
|
||||
|
||||
@@ -15,11 +15,11 @@ import {deflateCoordinate} from '../geom/flat/deflate.js';
|
||||
class Circle extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @param {!module:ol/coordinate~Coordinate} center Center.
|
||||
* @param {!import("../coordinate.js").Coordinate} center Center.
|
||||
* For internal use, flat coordinates in combination with `opt_layout` and no
|
||||
* `opt_radius` are also accepted.
|
||||
* @param {number=} opt_radius Radius.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||
*/
|
||||
constructor(center, opt_radius, opt_layout) {
|
||||
super();
|
||||
@@ -33,7 +33,7 @@ class Circle extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Make a complete copy of the geometry.
|
||||
* @return {!module:ol/geom/Circle} Clone.
|
||||
* @return {!import("./Circle.js").default} Clone.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -81,7 +81,7 @@ class Circle extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the center of the circle as {@link module:ol/coordinate~Coordinate coordinate}.
|
||||
* @return {module:ol/coordinate~Coordinate} Center.
|
||||
* @return {import("../coordinate.js").Coordinate} Center.
|
||||
* @api
|
||||
*/
|
||||
getCenter() {
|
||||
@@ -151,7 +151,7 @@ class Circle extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Set the center of the circle as {@link module:ol/coordinate~Coordinate coordinate}.
|
||||
* @param {module:ol/coordinate~Coordinate} center Center.
|
||||
* @param {import("../coordinate.js").Coordinate} center Center.
|
||||
* @api
|
||||
*/
|
||||
setCenter(center) {
|
||||
@@ -169,9 +169,9 @@ class Circle extends SimpleGeometry {
|
||||
/**
|
||||
* Set the center (as {@link module:ol/coordinate~Coordinate coordinate}) and the radius (as
|
||||
* number) of the circle.
|
||||
* @param {!module:ol/coordinate~Coordinate} center Center.
|
||||
* @param {!import("../coordinate.js").Coordinate} center Center.
|
||||
* @param {number} radius Radius.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||
* @api
|
||||
*/
|
||||
setCenterAndRadius(center, radius, opt_layout) {
|
||||
@@ -226,11 +226,11 @@ class Circle extends SimpleGeometry {
|
||||
* correspond to the shape that would be obtained by transforming every point
|
||||
* of the original circle.
|
||||
*
|
||||
* @param {module:ol/proj~ProjectionLike} source The current projection. Can be a
|
||||
* @param {import("../proj.js").ProjectionLike} source The current projection. Can be a
|
||||
* string identifier or a {@link module:ol/proj/Projection~Projection} object.
|
||||
* @param {module:ol/proj~ProjectionLike} destination The desired projection. Can be a
|
||||
* @param {import("../proj.js").ProjectionLike} destination The desired projection. Can be a
|
||||
* string identifier or a {@link module:ol/proj/Projection~Projection} object.
|
||||
* @return {module:ol/geom/Circle} This geometry. Note that original geometry is
|
||||
* @return {import("./Circle.js").default} This geometry. Note that original geometry is
|
||||
* modified in place.
|
||||
* @function
|
||||
* @api
|
||||
|
||||
@@ -11,7 +11,7 @@ import {create as createTransform, compose as composeTransform} from '../transfo
|
||||
|
||||
|
||||
/**
|
||||
* @type {module:ol/transform~Transform}
|
||||
* @type {import("../transform.js").Transform}
|
||||
*/
|
||||
const tmpTransform = createTransform();
|
||||
|
||||
@@ -35,7 +35,7 @@ class Geometry extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("../extent.js").Extent}
|
||||
*/
|
||||
this.extent_ = createEmpty();
|
||||
|
||||
@@ -47,7 +47,7 @@ class Geometry extends BaseObject {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {Object<string, module:ol/geom/Geometry>}
|
||||
* @type {Object<string, import("./Geometry.js").default>}
|
||||
*/
|
||||
this.simplifiedGeometryCache = {};
|
||||
|
||||
@@ -68,7 +68,7 @@ class Geometry extends BaseObject {
|
||||
/**
|
||||
* Make a complete copy of the geometry.
|
||||
* @abstract
|
||||
* @return {!module:ol/geom/Geometry} Clone.
|
||||
* @return {!import("./Geometry.js").default} Clone.
|
||||
*/
|
||||
clone() {}
|
||||
|
||||
@@ -76,7 +76,7 @@ class Geometry extends BaseObject {
|
||||
* @abstract
|
||||
* @param {number} x X.
|
||||
* @param {number} y Y.
|
||||
* @param {module:ol/coordinate~Coordinate} closestPoint Closest point.
|
||||
* @param {import("../coordinate.js").Coordinate} closestPoint Closest point.
|
||||
* @param {number} minSquaredDistance Minimum squared distance.
|
||||
* @return {number} Minimum squared distance.
|
||||
*/
|
||||
@@ -85,9 +85,9 @@ class Geometry extends BaseObject {
|
||||
/**
|
||||
* Return the closest point of the geometry to the passed point as
|
||||
* {@link module:ol/coordinate~Coordinate coordinate}.
|
||||
* @param {module:ol/coordinate~Coordinate} point Point.
|
||||
* @param {module:ol/coordinate~Coordinate=} opt_closestPoint Closest point.
|
||||
* @return {module:ol/coordinate~Coordinate} Closest point.
|
||||
* @param {import("../coordinate.js").Coordinate} point Point.
|
||||
* @param {import("../coordinate.js").Coordinate=} opt_closestPoint Closest point.
|
||||
* @return {import("../coordinate.js").Coordinate} Closest point.
|
||||
* @api
|
||||
*/
|
||||
getClosestPoint(point, opt_closestPoint) {
|
||||
@@ -99,7 +99,7 @@ class Geometry extends BaseObject {
|
||||
/**
|
||||
* Returns true if this geometry includes the specified coordinate. If the
|
||||
* coordinate is on the boundary of the geometry, returns false.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @return {boolean} Contains coordinate.
|
||||
* @api
|
||||
*/
|
||||
@@ -109,16 +109,16 @@ class Geometry extends BaseObject {
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("../extent.js").Extent} extent Extent.
|
||||
* @protected
|
||||
* @return {module:ol/extent~Extent} extent Extent.
|
||||
* @return {import("../extent.js").Extent} extent Extent.
|
||||
*/
|
||||
computeExtent(extent) {}
|
||||
|
||||
/**
|
||||
* Get the extent of the geometry.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("../extent.js").Extent=} opt_extent Extent.
|
||||
* @return {import("../extent.js").Extent} extent Extent.
|
||||
* @api
|
||||
*/
|
||||
getExtent(opt_extent) {
|
||||
@@ -134,7 +134,7 @@ class Geometry extends BaseObject {
|
||||
* coordinates in place.
|
||||
* @abstract
|
||||
* @param {number} angle Rotation angle in radians.
|
||||
* @param {module:ol/coordinate~Coordinate} anchor The rotation center.
|
||||
* @param {import("../coordinate.js").Coordinate} anchor The rotation center.
|
||||
* @api
|
||||
*/
|
||||
rotate(angle, anchor) {}
|
||||
@@ -146,7 +146,7 @@ class Geometry extends BaseObject {
|
||||
* @param {number} sx The scaling factor in the x-direction.
|
||||
* @param {number=} opt_sy The scaling factor in the y-direction (defaults to
|
||||
* sx).
|
||||
* @param {module:ol/coordinate~Coordinate=} opt_anchor The scale origin (defaults to the center
|
||||
* @param {import("../coordinate.js").Coordinate=} opt_anchor The scale origin (defaults to the center
|
||||
* of the geometry extent).
|
||||
* @api
|
||||
*/
|
||||
@@ -160,7 +160,7 @@ class Geometry extends BaseObject {
|
||||
* simplification is used to preserve topology.
|
||||
* @function
|
||||
* @param {number} tolerance The tolerance distance for simplification.
|
||||
* @return {module:ol/geom/Geometry} A new, simplified version of the original
|
||||
* @return {import("./Geometry.js").default} A new, simplified version of the original
|
||||
* geometry.
|
||||
* @api
|
||||
*/
|
||||
@@ -174,14 +174,14 @@ class Geometry extends BaseObject {
|
||||
* See https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm.
|
||||
* @abstract
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {module:ol/geom/Geometry} Simplified geometry.
|
||||
* @return {import("./Geometry.js").default} Simplified geometry.
|
||||
*/
|
||||
getSimplifiedGeometry(squaredTolerance) {}
|
||||
|
||||
/**
|
||||
* Get the type of this geometry.
|
||||
* @abstract
|
||||
* @return {module:ol/geom/GeometryType} Geometry type.
|
||||
* @return {import("./GeometryType.js").default} Geometry type.
|
||||
*/
|
||||
getType() {}
|
||||
|
||||
@@ -191,14 +191,14 @@ class Geometry extends BaseObject {
|
||||
* If you do not want the geometry modified in place, first `clone()` it and
|
||||
* then use this function on the clone.
|
||||
* @abstract
|
||||
* @param {module:ol/proj~TransformFunction} transformFn Transform.
|
||||
* @param {import("../proj.js").TransformFunction} transformFn Transform.
|
||||
*/
|
||||
applyTransform(transformFn) {}
|
||||
|
||||
/**
|
||||
* Test if the geometry and the passed extent intersect.
|
||||
* @abstract
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("../extent.js").Extent} extent Extent.
|
||||
* @return {boolean} `true` if the geometry and the extent intersect.
|
||||
*/
|
||||
intersectsExtent(extent) {}
|
||||
@@ -220,11 +220,11 @@ class Geometry extends BaseObject {
|
||||
* If you do not want the geometry modified in place, first `clone()` it and
|
||||
* then use this function on the clone.
|
||||
*
|
||||
* @param {module:ol/proj~ProjectionLike} source The current projection. Can be a
|
||||
* @param {import("../proj.js").ProjectionLike} source The current projection. Can be a
|
||||
* string identifier or a {@link module:ol/proj/Projection~Projection} object.
|
||||
* @param {module:ol/proj~ProjectionLike} destination The desired projection. Can be a
|
||||
* @param {import("../proj.js").ProjectionLike} destination The desired projection. Can be a
|
||||
* string identifier or a {@link module:ol/proj/Projection~Projection} object.
|
||||
* @return {module:ol/geom/Geometry} This geometry. Note that original geometry is
|
||||
* @return {import("./Geometry.js").default} This geometry. Note that original geometry is
|
||||
* modified in place.
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -17,7 +17,7 @@ import {clear} from '../obj.js';
|
||||
class GeometryCollection extends Geometry {
|
||||
|
||||
/**
|
||||
* @param {Array<module:ol/geom/Geometry>=} opt_geometries Geometries.
|
||||
* @param {Array<import("./Geometry.js").default>=} opt_geometries Geometries.
|
||||
*/
|
||||
constructor(opt_geometries) {
|
||||
|
||||
@@ -25,7 +25,7 @@ class GeometryCollection extends Geometry {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array<module:ol/geom/Geometry>}
|
||||
* @type {Array<import("./Geometry.js").default>}
|
||||
*/
|
||||
this.geometries_ = opt_geometries ? opt_geometries : null;
|
||||
|
||||
@@ -62,7 +62,7 @@ class GeometryCollection extends Geometry {
|
||||
|
||||
/**
|
||||
* Make a complete copy of the geometry.
|
||||
* @return {!module:ol/geom/GeometryCollection} Clone.
|
||||
* @return {!import("./GeometryCollection.js").default} Clone.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -114,7 +114,7 @@ class GeometryCollection extends Geometry {
|
||||
|
||||
/**
|
||||
* Return the geometries that make up this geometry collection.
|
||||
* @return {Array<module:ol/geom/Geometry>} Geometries.
|
||||
* @return {Array<import("./Geometry.js").default>} Geometries.
|
||||
* @api
|
||||
*/
|
||||
getGeometries() {
|
||||
@@ -122,7 +122,7 @@ class GeometryCollection extends Geometry {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array<module:ol/geom/Geometry>} Geometries.
|
||||
* @return {Array<import("./Geometry.js").default>} Geometries.
|
||||
*/
|
||||
getGeometriesArray() {
|
||||
return this.geometries_;
|
||||
@@ -228,7 +228,7 @@ class GeometryCollection extends Geometry {
|
||||
|
||||
/**
|
||||
* Set the geometries that make up this geometry collection.
|
||||
* @param {Array<module:ol/geom/Geometry>} geometries Geometries.
|
||||
* @param {Array<import("./Geometry.js").default>} geometries Geometries.
|
||||
* @api
|
||||
*/
|
||||
setGeometries(geometries) {
|
||||
@@ -236,7 +236,7 @@ class GeometryCollection extends Geometry {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array<module:ol/geom/Geometry>} geometries Geometries.
|
||||
* @param {Array<import("./Geometry.js").default>} geometries Geometries.
|
||||
*/
|
||||
setGeometriesArray(geometries) {
|
||||
this.unlistenGeometriesChange_();
|
||||
@@ -280,8 +280,8 @@ class GeometryCollection extends Geometry {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array<module:ol/geom/Geometry>} geometries Geometries.
|
||||
* @return {Array<module:ol/geom/Geometry>} Cloned geometries.
|
||||
* @param {Array<import("./Geometry.js").default>} geometries Geometries.
|
||||
* @return {Array<import("./Geometry.js").default>} Cloned geometries.
|
||||
*/
|
||||
function cloneGeometries(geometries) {
|
||||
const clonedGeometries = [];
|
||||
|
||||
@@ -24,9 +24,9 @@ import {douglasPeucker} from '../geom/flat/simplify.js';
|
||||
class LineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @param {Array<module:ol/coordinate~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.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||
*/
|
||||
constructor(coordinates, opt_layout) {
|
||||
|
||||
@@ -34,7 +34,7 @@ class LineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/coordinate~Coordinate}
|
||||
* @type {import("../coordinate.js").Coordinate}
|
||||
*/
|
||||
this.flatMidpoint_ = null;
|
||||
|
||||
@@ -66,7 +66,7 @@ class LineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Append the passed coordinate to the coordinates of the linestring.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @api
|
||||
*/
|
||||
appendCoordinate(coordinate) {
|
||||
@@ -80,7 +80,7 @@ class LineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Make a complete copy of the geometry.
|
||||
* @return {!module:ol/geom/LineString} Clone.
|
||||
* @return {!import("./LineString.js").default} Clone.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -110,7 +110,7 @@ class LineString extends SimpleGeometry {
|
||||
* If the callback returns a truthy value the function returns that
|
||||
* value immediately. Otherwise the function returns `false`.
|
||||
*
|
||||
* @param {function(this: S, module:ol/coordinate~Coordinate, module:ol/coordinate~Coordinate): T} callback Function
|
||||
* @param {function(this: S, import("../coordinate.js").Coordinate, import("../coordinate.js").Coordinate): T} callback Function
|
||||
* called for each segment.
|
||||
* @return {T|boolean} Value.
|
||||
* @template T,S
|
||||
@@ -131,7 +131,7 @@ class LineString extends SimpleGeometry {
|
||||
*
|
||||
* @param {number} m M.
|
||||
* @param {boolean=} opt_extrapolate Extrapolate. Default is `false`.
|
||||
* @return {module:ol/coordinate~Coordinate} Coordinate.
|
||||
* @return {import("../coordinate.js").Coordinate} Coordinate.
|
||||
* @api
|
||||
*/
|
||||
getCoordinateAtM(m, opt_extrapolate) {
|
||||
@@ -146,7 +146,7 @@ class LineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the coordinates of the linestring.
|
||||
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates.
|
||||
* @return {Array<import("../coordinate.js").Coordinate>} Coordinates.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -160,9 +160,9 @@ class LineString extends SimpleGeometry {
|
||||
* The `fraction` is a number between 0 and 1, where 0 is the start of the
|
||||
* linestring and 1 is the end.
|
||||
* @param {number} fraction Fraction.
|
||||
* @param {module:ol/coordinate~Coordinate=} opt_dest Optional coordinate whose values will
|
||||
* @param {import("../coordinate.js").Coordinate=} opt_dest Optional coordinate whose values will
|
||||
* be modified. If not provided, a new coordinate will be returned.
|
||||
* @return {module:ol/coordinate~Coordinate} Coordinate of the interpolated point.
|
||||
* @return {import("../coordinate.js").Coordinate} Coordinate of the interpolated point.
|
||||
* @api
|
||||
*/
|
||||
getCoordinateAt(fraction, opt_dest) {
|
||||
@@ -223,8 +223,8 @@ class LineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Set the coordinates of the linestring.
|
||||
* @param {!Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {!Array<import("../coordinate.js").Coordinate>} coordinates Coordinates.
|
||||
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -21,9 +21,9 @@ import {douglasPeucker} from '../geom/flat/simplify.js';
|
||||
class LinearRing extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @param {Array<module:ol/coordinate~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.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||
*/
|
||||
constructor(coordinates, opt_layout) {
|
||||
|
||||
@@ -51,7 +51,7 @@ class LinearRing extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Make a complete copy of the geometry.
|
||||
* @return {!module:ol/geom/LinearRing} Clone.
|
||||
* @return {!import("./LinearRing.js").default} Clone.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -87,7 +87,7 @@ class LinearRing extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the coordinates of the linear ring.
|
||||
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates.
|
||||
* @return {Array<import("../coordinate.js").Coordinate>} Coordinates.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -122,8 +122,8 @@ class LinearRing extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Set the coordinates of the linear ring.
|
||||
* @param {!Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {!Array<import("../coordinate.js").Coordinate>} coordinates Coordinates.
|
||||
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -23,10 +23,10 @@ import {douglasPeuckerArray} from '../geom/flat/simplify.js';
|
||||
class MultiLineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>|module:ol/geom~MultiLineString>|Array<number>} coordinates
|
||||
* @param {Array<Array<import("../coordinate.js").Coordinate>|import("../geom.js").MultiLineString>|Array<number>} coordinates
|
||||
* Coordinates or LineString geometries. (For internal use, flat coordinates in
|
||||
* combination with `opt_layout` and `opt_ends` are also accepted.)
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||
* @param {Array<number>} opt_ends Flat coordinate ends for internal use.
|
||||
*/
|
||||
constructor(coordinates, opt_layout, opt_ends) {
|
||||
@@ -76,7 +76,7 @@ class MultiLineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Append the passed linestring to the multilinestring.
|
||||
* @param {module:ol/geom/LineString} lineString LineString.
|
||||
* @param {import("./LineString.js").default} lineString LineString.
|
||||
* @api
|
||||
*/
|
||||
appendLineString(lineString) {
|
||||
@@ -91,7 +91,7 @@ class MultiLineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Make a complete copy of the geometry.
|
||||
* @return {!module:ol/geom/MultiLineString} Clone.
|
||||
* @return {!import("./MultiLineString.js").default} Clone.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -135,7 +135,7 @@ class MultiLineString extends SimpleGeometry {
|
||||
* @param {number} m M.
|
||||
* @param {boolean=} opt_extrapolate Extrapolate. Default is `false`.
|
||||
* @param {boolean=} opt_interpolate Interpolate. Default is `false`.
|
||||
* @return {module:ol/coordinate~Coordinate} Coordinate.
|
||||
* @return {import("../coordinate.js").Coordinate} Coordinate.
|
||||
* @api
|
||||
*/
|
||||
getCoordinateAtM(m, opt_extrapolate, opt_interpolate) {
|
||||
@@ -152,7 +152,7 @@ class MultiLineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the coordinates of the multilinestring.
|
||||
* @return {Array<Array<module:ol/coordinate~Coordinate>>} Coordinates.
|
||||
* @return {Array<Array<import("../coordinate.js").Coordinate>>} Coordinates.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -171,7 +171,7 @@ class MultiLineString extends SimpleGeometry {
|
||||
/**
|
||||
* Return the linestring at the specified index.
|
||||
* @param {number} index Index.
|
||||
* @return {module:ol/geom/LineString} LineString.
|
||||
* @return {import("./LineString.js").default} LineString.
|
||||
* @api
|
||||
*/
|
||||
getLineString(index) {
|
||||
@@ -184,14 +184,14 @@ class MultiLineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the linestrings of this multilinestring.
|
||||
* @return {Array<module:ol/geom/LineString>} LineStrings.
|
||||
* @return {Array<import("./LineString.js").default>} LineStrings.
|
||||
* @api
|
||||
*/
|
||||
getLineStrings() {
|
||||
const flatCoordinates = this.flatCoordinates;
|
||||
const ends = this.ends_;
|
||||
const layout = this.layout;
|
||||
/** @type {Array<module:ol/geom/LineString>} */
|
||||
/** @type {Array<import("./LineString.js").default>} */
|
||||
const lineStrings = [];
|
||||
let offset = 0;
|
||||
for (let i = 0, ii = ends.length; i < ii; ++i) {
|
||||
@@ -253,8 +253,8 @@ class MultiLineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Set the coordinates of the multilinestring.
|
||||
* @param {!Array<Array<module:ol/coordinate~Coordinate>>} coordinates Coordinates.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {!Array<Array<import("../coordinate.js").Coordinate>>} coordinates Coordinates.
|
||||
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -19,9 +19,9 @@ import {squaredDistance as squaredDx} from '../math.js';
|
||||
class MultiPoint extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @param {Array<module:ol/coordinate~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.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||
*/
|
||||
constructor(coordinates, opt_layout) {
|
||||
super();
|
||||
@@ -34,7 +34,7 @@ class MultiPoint extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Append the passed point to this multipoint.
|
||||
* @param {module:ol/geom/Point} point Point.
|
||||
* @param {import("./Point.js").default} point Point.
|
||||
* @api
|
||||
*/
|
||||
appendPoint(point) {
|
||||
@@ -48,7 +48,7 @@ class MultiPoint extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Make a complete copy of the geometry.
|
||||
* @return {!module:ol/geom/MultiPoint} Clone.
|
||||
* @return {!import("./MultiPoint.js").default} Clone.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -82,7 +82,7 @@ class MultiPoint extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the coordinates of the multipoint.
|
||||
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates.
|
||||
* @return {Array<import("../coordinate.js").Coordinate>} Coordinates.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -94,7 +94,7 @@ class MultiPoint extends SimpleGeometry {
|
||||
/**
|
||||
* Return the point at the specified index.
|
||||
* @param {number} index Index.
|
||||
* @return {module:ol/geom/Point} Point.
|
||||
* @return {import("./Point.js").default} Point.
|
||||
* @api
|
||||
*/
|
||||
getPoint(index) {
|
||||
@@ -108,14 +108,14 @@ class MultiPoint extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the points of this multipoint.
|
||||
* @return {Array<module:ol/geom/Point>} Points.
|
||||
* @return {Array<import("./Point.js").default>} Points.
|
||||
* @api
|
||||
*/
|
||||
getPoints() {
|
||||
const flatCoordinates = this.flatCoordinates;
|
||||
const layout = this.layout;
|
||||
const stride = this.stride;
|
||||
/** @type {Array<module:ol/geom/Point>} */
|
||||
/** @type {Array<import("./Point.js").default>} */
|
||||
const points = [];
|
||||
for (let i = 0, ii = flatCoordinates.length; i < ii; i += stride) {
|
||||
const point = new Point(flatCoordinates.slice(i, i + stride), layout);
|
||||
@@ -151,8 +151,8 @@ class MultiPoint extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Set the coordinates of the multipoint.
|
||||
* @param {!Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {!Array<import("../coordinate.js").Coordinate>} coordinates Coordinates.
|
||||
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -28,9 +28,9 @@ import {quantizeMultiArray} from '../geom/flat/simplify.js';
|
||||
class MultiPolygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @param {Array<Array<Array<module:ol/coordinate~Coordinate>>>|Array<number>} coordinates Coordinates.
|
||||
* @param {Array<Array<Array<import("../coordinate.js").Coordinate>>>|Array<number>} coordinates Coordinates.
|
||||
* For internal use, flat coordinats in combination with `opt_layout` and `opt_endss` are also accepted.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||
* @param {Array<number>} opt_endss Array of ends for internal use with flat coordinates.
|
||||
*/
|
||||
constructor(coordinates, opt_layout, opt_endss) {
|
||||
@@ -111,7 +111,7 @@ class MultiPolygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Append the passed polygon to this multipolygon.
|
||||
* @param {module:ol/geom/Polygon} polygon Polygon.
|
||||
* @param {import("./Polygon.js").default} polygon Polygon.
|
||||
* @api
|
||||
*/
|
||||
appendPolygon(polygon) {
|
||||
@@ -135,7 +135,7 @@ class MultiPolygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Make a complete copy of the geometry.
|
||||
* @return {!module:ol/geom/MultiPolygon} Clone.
|
||||
* @return {!import("./MultiPolygon.js").default} Clone.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -193,7 +193,7 @@ class MultiPolygon extends SimpleGeometry {
|
||||
* (clockwise for exterior and counter-clockwise for interior rings).
|
||||
* By default, coordinate orientation will depend on how the geometry was
|
||||
* constructed.
|
||||
* @return {Array<Array<Array<module:ol/coordinate~Coordinate>>>} Coordinates.
|
||||
* @return {Array<Array<Array<import("../coordinate.js").Coordinate>>>} Coordinates.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -235,7 +235,7 @@ class MultiPolygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the interior points as {@link module:ol/geom/MultiPoint multipoint}.
|
||||
* @return {module:ol/geom/MultiPoint} Interior points as XYM coordinates, where M is
|
||||
* @return {import("./MultiPoint.js").default} Interior points as XYM coordinates, where M is
|
||||
* the length of the horizontal intersection that the point belongs to.
|
||||
* @api
|
||||
*/
|
||||
@@ -279,7 +279,7 @@ class MultiPolygon extends SimpleGeometry {
|
||||
/**
|
||||
* Return the polygon at the specified index.
|
||||
* @param {number} index Index.
|
||||
* @return {module:ol/geom/Polygon} Polygon.
|
||||
* @return {import("./Polygon.js").default} Polygon.
|
||||
* @api
|
||||
*/
|
||||
getPolygon(index) {
|
||||
@@ -305,7 +305,7 @@ class MultiPolygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the polygons of this multipolygon.
|
||||
* @return {Array<module:ol/geom/Polygon>} Polygons.
|
||||
* @return {Array<import("./Polygon.js").default>} Polygons.
|
||||
* @api
|
||||
*/
|
||||
getPolygons() {
|
||||
@@ -348,8 +348,8 @@ class MultiPolygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Set the coordinates of the multipolygon.
|
||||
* @param {!Array<Array<Array<module:ol/coordinate~Coordinate>>>} coordinates Coordinates.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {!Array<Array<Array<import("../coordinate.js").Coordinate>>>} coordinates Coordinates.
|
||||
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -16,8 +16,8 @@ import {squaredDistance as squaredDx} from '../math.js';
|
||||
class Point extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @param {module:ol/coordinate~Coordinate} coordinates Coordinates.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {import("../coordinate.js").Coordinate} coordinates Coordinates.
|
||||
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||
*/
|
||||
constructor(coordinates, opt_layout) {
|
||||
super();
|
||||
@@ -26,7 +26,7 @@ class Point extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Make a complete copy of the geometry.
|
||||
* @return {!module:ol/geom/Point} Clone.
|
||||
* @return {!import("./Point.js").default} Clone.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -55,7 +55,7 @@ class Point extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the coordinate of the point.
|
||||
* @return {module:ol/coordinate~Coordinate} Coordinates.
|
||||
* @return {import("../coordinate.js").Coordinate} Coordinates.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -29,14 +29,14 @@ import {modulo} from '../math.js';
|
||||
class Polygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @param {!Array<Array<module:ol/coordinate~Coordinate>>|!Array<number>} coordinates
|
||||
* @param {!Array<Array<import("../coordinate.js").Coordinate>>|!Array<number>} coordinates
|
||||
* Array of linear rings that define the polygon. The first linear ring of the
|
||||
* array defines the outer-boundary or surface of the polygon. Each subsequent
|
||||
* linear ring defines a hole in the surface of the polygon. A linear ring is
|
||||
* an array of vertices' coordinates where the first coordinate and the last are
|
||||
* equivalent. (For internal use, flat coordinates in combination with
|
||||
* `opt_layout` and `opt_ends` are also accepted.)
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||
* @param {Array<number>=} opt_ends Ends (for internal use with flat coordinates).
|
||||
*/
|
||||
constructor(coordinates, opt_layout, opt_ends) {
|
||||
@@ -57,7 +57,7 @@ class Polygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/coordinate~Coordinate}
|
||||
* @type {import("../coordinate.js").Coordinate}
|
||||
*/
|
||||
this.flatInteriorPoint_ = null;
|
||||
|
||||
@@ -96,7 +96,7 @@ class Polygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Append the passed linear ring to this polygon.
|
||||
* @param {module:ol/geom/LinearRing} linearRing Linear ring.
|
||||
* @param {import("./LinearRing.js").default} linearRing Linear ring.
|
||||
* @api
|
||||
*/
|
||||
appendLinearRing(linearRing) {
|
||||
@@ -111,7 +111,7 @@ class Polygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Make a complete copy of the geometry.
|
||||
* @return {!module:ol/geom/Polygon} Clone.
|
||||
* @return {!import("./Polygon.js").default} Clone.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -162,7 +162,7 @@ class Polygon extends SimpleGeometry {
|
||||
* (clockwise for exterior and counter-clockwise for interior rings).
|
||||
* By default, coordinate orientation will depend on how the geometry was
|
||||
* constructed.
|
||||
* @return {Array<Array<module:ol/coordinate~Coordinate>>} Coordinates.
|
||||
* @return {Array<Array<import("../coordinate.js").Coordinate>>} Coordinates.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -203,7 +203,7 @@ class Polygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return an interior point of the polygon.
|
||||
* @return {module:ol/geom/Point} Interior point as XYM coordinate, where M is the
|
||||
* @return {import("./Point.js").default} Interior point as XYM coordinate, where M is the
|
||||
* length of the horizontal intersection that the point belongs to.
|
||||
* @api
|
||||
*/
|
||||
@@ -229,7 +229,7 @@ class Polygon extends SimpleGeometry {
|
||||
* at index `1` and beyond.
|
||||
*
|
||||
* @param {number} index Index.
|
||||
* @return {module:ol/geom/LinearRing} Linear ring.
|
||||
* @return {import("./LinearRing.js").default} Linear ring.
|
||||
* @api
|
||||
*/
|
||||
getLinearRing(index) {
|
||||
@@ -242,7 +242,7 @@ class Polygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the linear rings of the polygon.
|
||||
* @return {Array<module:ol/geom/LinearRing>} Linear rings.
|
||||
* @return {Array<import("./LinearRing.js").default>} Linear rings.
|
||||
* @api
|
||||
*/
|
||||
getLinearRings() {
|
||||
@@ -312,8 +312,8 @@ class Polygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Set the coordinates of the polygon.
|
||||
* @param {!Array<Array<module:ol/coordinate~Coordinate>>} coordinates Coordinates.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {!Array<Array<import("../coordinate.js").Coordinate>>} coordinates Coordinates.
|
||||
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -335,14 +335,14 @@ export default Polygon;
|
||||
|
||||
/**
|
||||
* Create an approximation of a circle on the surface of a sphere.
|
||||
* @param {module:ol/coordinate~Coordinate} center Center (`[lon, lat]` in degrees).
|
||||
* @param {import("../coordinate.js").Coordinate} center Center (`[lon, lat]` in degrees).
|
||||
* @param {number} radius The great-circle distance from the center to
|
||||
* the polygon vertices.
|
||||
* @param {number=} opt_n Optional number of vertices for the resulting
|
||||
* polygon. Default is `32`.
|
||||
* @param {number=} opt_sphereRadius Optional radius for the sphere (defaults to
|
||||
* the Earth's mean radius using the WGS84 ellipsoid).
|
||||
* @return {module:ol/geom/Polygon} The "circular" polygon.
|
||||
* @return {import("./Polygon.js").default} The "circular" polygon.
|
||||
* @api
|
||||
*/
|
||||
export function circular(center, radius, opt_n, opt_sphereRadius) {
|
||||
@@ -359,8 +359,8 @@ export function circular(center, radius, opt_n, opt_sphereRadius) {
|
||||
|
||||
/**
|
||||
* Create a polygon from an extent. The layout used is `XY`.
|
||||
* @param {module:ol/extent~Extent} extent The extent.
|
||||
* @return {module:ol/geom/Polygon} The polygon.
|
||||
* @param {import("../extent.js").Extent} extent The extent.
|
||||
* @return {import("./Polygon.js").default} The polygon.
|
||||
* @api
|
||||
*/
|
||||
export function fromExtent(extent) {
|
||||
@@ -376,11 +376,11 @@ export function fromExtent(extent) {
|
||||
|
||||
/**
|
||||
* Create a regular polygon from a circle.
|
||||
* @param {module:ol/geom/Circle} circle Circle geometry.
|
||||
* @param {import("./Circle.js").default} circle Circle geometry.
|
||||
* @param {number=} opt_sides Number of sides of the polygon. Default is 32.
|
||||
* @param {number=} opt_angle Start angle for the first vertex of the polygon in
|
||||
* radians. Default is 0.
|
||||
* @return {module:ol/geom/Polygon} Polygon geometry.
|
||||
* @return {import("./Polygon.js").default} Polygon geometry.
|
||||
* @api
|
||||
*/
|
||||
export function fromCircle(circle, opt_sides, opt_angle) {
|
||||
@@ -406,8 +406,8 @@ export function fromCircle(circle, opt_sides, opt_angle) {
|
||||
|
||||
/**
|
||||
* Modify the coordinates of a polygon to make it a regular polygon.
|
||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||
* @param {module:ol/coordinate~Coordinate} center Center of the regular polygon.
|
||||
* @param {import("./Polygon.js").default} polygon Polygon geometry.
|
||||
* @param {import("../coordinate.js").Coordinate} center Center of the regular polygon.
|
||||
* @param {number} radius Radius of the regular polygon.
|
||||
* @param {number=} opt_angle Start angle for the first vertex of the polygon in
|
||||
* radians. Default is 0.
|
||||
|
||||
@@ -23,7 +23,7 @@ class SimpleGeometry extends Geometry {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {module:ol/geom/GeometryLayout}
|
||||
* @type {import("./GeometryLayout.js").default}
|
||||
*/
|
||||
this.layout = GeometryLayout.XY;
|
||||
|
||||
@@ -57,7 +57,7 @@ class SimpleGeometry extends Geometry {
|
||||
|
||||
/**
|
||||
* Return the first coordinate of the geometry.
|
||||
* @return {module:ol/coordinate~Coordinate} First coordinate.
|
||||
* @return {import("../coordinate.js").Coordinate} First coordinate.
|
||||
* @api
|
||||
*/
|
||||
getFirstCoordinate() {
|
||||
@@ -73,7 +73,7 @@ class SimpleGeometry extends Geometry {
|
||||
|
||||
/**
|
||||
* Return the last coordinate of the geometry.
|
||||
* @return {module:ol/coordinate~Coordinate} Last point.
|
||||
* @return {import("../coordinate.js").Coordinate} Last point.
|
||||
* @api
|
||||
*/
|
||||
getLastCoordinate() {
|
||||
@@ -82,7 +82,7 @@ class SimpleGeometry extends Geometry {
|
||||
|
||||
/**
|
||||
* Return the {@link module:ol/geom/GeometryLayout~GeometryLayout layout} of the geometry.
|
||||
* @return {module:ol/geom/GeometryLayout} Layout.
|
||||
* @return {import("./GeometryLayout.js").default} Layout.
|
||||
* @api
|
||||
*/
|
||||
getLayout() {
|
||||
@@ -130,7 +130,7 @@ class SimpleGeometry extends Geometry {
|
||||
|
||||
/**
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {module:ol/geom/SimpleGeometry} Simplified geometry.
|
||||
* @return {import("./SimpleGeometry.js").default} Simplified geometry.
|
||||
* @protected
|
||||
*/
|
||||
getSimplifiedGeometryInternal(squaredTolerance) {
|
||||
@@ -145,7 +145,7 @@ class SimpleGeometry extends Geometry {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/GeometryLayout} layout Layout.
|
||||
* @param {import("./GeometryLayout.js").default} layout Layout.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
*/
|
||||
setFlatCoordinates(layout, flatCoordinates) {
|
||||
@@ -157,12 +157,12 @@ class SimpleGeometry extends Geometry {
|
||||
/**
|
||||
* @abstract
|
||||
* @param {!Array} coordinates Coordinates.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||
*/
|
||||
setCoordinates(coordinates, opt_layout) {}
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/GeometryLayout|undefined} layout Layout.
|
||||
* @param {import("./GeometryLayout.js").default|undefined} layout Layout.
|
||||
* @param {Array} coordinates Coordinates.
|
||||
* @param {number} nesting Nesting.
|
||||
* @protected
|
||||
@@ -257,7 +257,7 @@ class SimpleGeometry extends Geometry {
|
||||
|
||||
/**
|
||||
* @param {number} stride Stride.
|
||||
* @return {module:ol/geom/GeometryLayout} layout Layout.
|
||||
* @return {import("./GeometryLayout.js").default} layout Layout.
|
||||
*/
|
||||
function getLayoutForStride(stride) {
|
||||
let layout;
|
||||
@@ -269,13 +269,13 @@ function getLayoutForStride(stride) {
|
||||
layout = GeometryLayout.XYZM;
|
||||
}
|
||||
return (
|
||||
/** @type {module:ol/geom/GeometryLayout} */ (layout)
|
||||
/** @type {import("./GeometryLayout.js").default} */ (layout)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/GeometryLayout} layout Layout.
|
||||
* @param {import("./GeometryLayout.js").default} layout Layout.
|
||||
* @return {number} Stride.
|
||||
*/
|
||||
export function getStrideForLayout(layout) {
|
||||
@@ -298,8 +298,8 @@ SimpleGeometry.prototype.containsXY = FALSE;
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/SimpleGeometry} simpleGeometry Simple geometry.
|
||||
* @param {module:ol/transform~Transform} transform Transform.
|
||||
* @param {import("./SimpleGeometry.js").default} simpleGeometry Simple geometry.
|
||||
* @param {import("../transform.js").Transform} transform Transform.
|
||||
* @param {Array<number>=} opt_dest Destination.
|
||||
* @return {Array<number>} Transformed flat coordinates.
|
||||
*/
|
||||
|
||||
@@ -9,13 +9,13 @@ import {forEachCorner} from '../../extent.js';
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("../../extent.js").Extent} extent Extent.
|
||||
* @return {boolean} Contains extent.
|
||||
*/
|
||||
export function linearRingContainsExtent(flatCoordinates, offset, end, stride, extent) {
|
||||
const outside = forEachCorner(extent,
|
||||
/**
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @return {boolean} Contains (x, y).
|
||||
*/
|
||||
function(coordinate) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/**
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {number} stride Stride.
|
||||
* @return {number} offset Offset.
|
||||
*/
|
||||
@@ -21,7 +21,7 @@ export function deflateCoordinate(flatCoordinates, offset, coordinate, stride) {
|
||||
/**
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @param {Array<import("../../coordinate.js").Coordinate>} coordinates Coordinates.
|
||||
* @param {number} stride Stride.
|
||||
* @return {number} offset Offset.
|
||||
*/
|
||||
@@ -39,7 +39,7 @@ export function deflateCoordinates(flatCoordinates, offset, coordinates, stride)
|
||||
/**
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} coordinatess Coordinatess.
|
||||
* @param {Array<Array<import("../../coordinate.js").Coordinate>>} coordinatess Coordinatess.
|
||||
* @param {number} stride Stride.
|
||||
* @param {Array<number>=} opt_ends Ends.
|
||||
* @return {Array<number>} Ends.
|
||||
@@ -61,7 +61,7 @@ export function deflateCoordinatesArray(flatCoordinates, offset, coordinatess, s
|
||||
/**
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array<Array<Array<module:ol/coordinate~Coordinate>>>} coordinatesss Coordinatesss.
|
||||
* @param {Array<Array<Array<import("../../coordinate.js").Coordinate>>>} coordinatesss Coordinatesss.
|
||||
* @param {number} stride Stride.
|
||||
* @param {Array<Array<number>>=} opt_endss Endss.
|
||||
* @return {Array<Array<number>>} Endss.
|
||||
|
||||
@@ -6,8 +6,8 @@ import {get as getProjection, getTransform} from '../../proj.js';
|
||||
|
||||
|
||||
/**
|
||||
* @param {function(number): module:ol/coordinate~Coordinate} interpolate Interpolate function.
|
||||
* @param {module:ol/proj~TransformFunction} transform Transform from longitude/latitude to
|
||||
* @param {function(number): import("../../coordinate.js").Coordinate} interpolate Interpolate function.
|
||||
* @param {import("../../proj.js").TransformFunction} transform Transform from longitude/latitude to
|
||||
* projected coordinates.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {Array<number>} Flat coordinates.
|
||||
@@ -25,9 +25,9 @@ function line(interpolate, transform, squaredTolerance) {
|
||||
let a = transform(geoA);
|
||||
let b = transform(geoB);
|
||||
|
||||
/** @type {Array<module:ol/coordinate~Coordinate>} */
|
||||
/** @type {Array<import("../../coordinate.js").Coordinate>} */
|
||||
const geoStack = [geoB, geoA];
|
||||
/** @type {Array<module:ol/coordinate~Coordinate>} */
|
||||
/** @type {Array<import("../../coordinate.js").Coordinate>} */
|
||||
const stack = [b, a];
|
||||
/** @type {Array<number>} */
|
||||
const fractionStack = [1, 0];
|
||||
@@ -84,7 +84,7 @@ function line(interpolate, transform, squaredTolerance) {
|
||||
* @param {number} lat1 Latitude 1 in degrees.
|
||||
* @param {number} lon2 Longitude 2 in degrees.
|
||||
* @param {number} lat2 Latitude 2 in degrees.
|
||||
* @param {module:ol/proj/Projection} projection Projection.
|
||||
* @param {import("../../proj/Projection.js").default} projection Projection.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {Array<number>} Flat coordinates.
|
||||
*/
|
||||
@@ -102,7 +102,7 @@ export function greatCircleArc(lon1, lat1, lon2, lat2, projection, squaredTolera
|
||||
return line(
|
||||
/**
|
||||
* @param {number} frac Fraction.
|
||||
* @return {module:ol/coordinate~Coordinate} Coordinate.
|
||||
* @return {import("../../coordinate.js").Coordinate} Coordinate.
|
||||
*/
|
||||
function(frac) {
|
||||
if (1 <= d) {
|
||||
@@ -128,7 +128,7 @@ export function greatCircleArc(lon1, lat1, lon2, lat2, projection, squaredTolera
|
||||
* @param {number} lon Longitude.
|
||||
* @param {number} lat1 Latitude 1.
|
||||
* @param {number} lat2 Latitude 2.
|
||||
* @param {module:ol/proj/Projection} projection Projection.
|
||||
* @param {import("../../proj/Projection.js").default} projection Projection.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {Array<number>} Flat coordinates.
|
||||
*/
|
||||
@@ -137,7 +137,7 @@ export function meridian(lon, lat1, lat2, projection, squaredTolerance) {
|
||||
return line(
|
||||
/**
|
||||
* @param {number} frac Fraction.
|
||||
* @return {module:ol/coordinate~Coordinate} Coordinate.
|
||||
* @return {import("../../coordinate.js").Coordinate} Coordinate.
|
||||
*/
|
||||
function(frac) {
|
||||
return [lon, lat1 + ((lat2 - lat1) * frac)];
|
||||
@@ -151,7 +151,7 @@ export function meridian(lon, lat1, lat2, projection, squaredTolerance) {
|
||||
* @param {number} lat Latitude.
|
||||
* @param {number} lon1 Longitude 1.
|
||||
* @param {number} lon2 Longitude 2.
|
||||
* @param {module:ol/proj/Projection} projection Projection.
|
||||
* @param {import("../../proj/Projection.js").default} projection Projection.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {Array<number>} Flat coordinates.
|
||||
*/
|
||||
@@ -160,7 +160,7 @@ export function parallel(lat, lon1, lon2, projection, squaredTolerance) {
|
||||
return line(
|
||||
/**
|
||||
* @param {number} frac Fraction.
|
||||
* @return {module:ol/coordinate~Coordinate} Coordinate.
|
||||
* @return {import("../../coordinate.js").Coordinate} Coordinate.
|
||||
*/
|
||||
function(frac) {
|
||||
return [lon1 + ((lon2 - lon1) * frac), lat];
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {Array<module:ol/coordinate~Coordinate>=} opt_coordinates Coordinates.
|
||||
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates.
|
||||
* @param {Array<import("../../coordinate.js").Coordinate>=} opt_coordinates Coordinates.
|
||||
* @return {Array<import("../../coordinate.js").Coordinate>} Coordinates.
|
||||
*/
|
||||
export function inflateCoordinates(flatCoordinates, offset, end, stride, opt_coordinates) {
|
||||
const coordinates = opt_coordinates !== undefined ? opt_coordinates : [];
|
||||
@@ -27,8 +27,8 @@ export function inflateCoordinates(flatCoordinates, offset, end, stride, opt_coo
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array<number>} ends Ends.
|
||||
* @param {number} stride Stride.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>=} opt_coordinatess Coordinatess.
|
||||
* @return {Array<Array<module:ol/coordinate~Coordinate>>} Coordinatess.
|
||||
* @param {Array<Array<import("../../coordinate.js").Coordinate>>=} opt_coordinatess Coordinatess.
|
||||
* @return {Array<Array<import("../../coordinate.js").Coordinate>>} Coordinatess.
|
||||
*/
|
||||
export function inflateCoordinatesArray(flatCoordinates, offset, ends, stride, opt_coordinatess) {
|
||||
const coordinatess = opt_coordinatess !== undefined ? opt_coordinatess : [];
|
||||
@@ -49,9 +49,9 @@ export function inflateCoordinatesArray(flatCoordinates, offset, ends, stride, o
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array<Array<number>>} endss Endss.
|
||||
* @param {number} stride Stride.
|
||||
* @param {Array<Array<Array<module:ol/coordinate~Coordinate>>>=} opt_coordinatesss
|
||||
* @param {Array<Array<Array<import("../../coordinate.js").Coordinate>>>=} opt_coordinatesss
|
||||
* Coordinatesss.
|
||||
* @return {Array<Array<Array<module:ol/coordinate~Coordinate>>>} Coordinatesss.
|
||||
* @return {Array<Array<Array<import("../../coordinate.js").Coordinate>>>} Coordinatesss.
|
||||
*/
|
||||
export function inflateMultiCoordinatesArray(flatCoordinates, offset, endss, stride, opt_coordinatesss) {
|
||||
const coordinatesss = opt_coordinatesss !== undefined ? opt_coordinatesss : [];
|
||||
|
||||
@@ -71,7 +71,7 @@ export function interpolatePoint(flatCoordinates, offset, end, stride, fraction,
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} m M.
|
||||
* @param {boolean} extrapolate Extrapolate.
|
||||
* @return {module:ol/coordinate~Coordinate} Coordinate.
|
||||
* @return {import("../../coordinate.js").Coordinate} Coordinate.
|
||||
*/
|
||||
export function lineStringCoordinateAtM(flatCoordinates, offset, end, stride, m, extrapolate) {
|
||||
if (end == offset) {
|
||||
@@ -133,7 +133,7 @@ export function lineStringCoordinateAtM(flatCoordinates, offset, end, stride, m,
|
||||
* @param {number} m M.
|
||||
* @param {boolean} extrapolate Extrapolate.
|
||||
* @param {boolean} interpolate Interpolate.
|
||||
* @return {module:ol/coordinate~Coordinate} Coordinate.
|
||||
* @return {import("../../coordinate.js").Coordinate} Coordinate.
|
||||
*/
|
||||
export function lineStringsCoordinateAtM(
|
||||
flatCoordinates, offset, ends, stride, m, extrapolate, interpolate) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import {forEach as forEachSegment} from '../flat/segments.js';
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("../../extent.js").Extent} extent Extent.
|
||||
* @return {boolean} True if the geometry and the extent intersect.
|
||||
*/
|
||||
export function intersectsLineString(flatCoordinates, offset, end, stride, extent) {
|
||||
@@ -33,8 +33,8 @@ export function intersectsLineString(flatCoordinates, offset, end, stride, exten
|
||||
}
|
||||
return forEachSegment(flatCoordinates, offset, end, stride,
|
||||
/**
|
||||
* @param {module:ol/coordinate~Coordinate} point1 Start point.
|
||||
* @param {module:ol/coordinate~Coordinate} point2 End point.
|
||||
* @param {import("../../coordinate.js").Coordinate} point1 Start point.
|
||||
* @param {import("../../coordinate.js").Coordinate} point2 End point.
|
||||
* @return {boolean} `true` if the segment and the extent intersect,
|
||||
* `false` otherwise.
|
||||
*/
|
||||
@@ -49,7 +49,7 @@ export function intersectsLineString(flatCoordinates, offset, end, stride, exten
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array<number>} ends Ends.
|
||||
* @param {number} stride Stride.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("../../extent.js").Extent} extent Extent.
|
||||
* @return {boolean} True if the geometry and the extent intersect.
|
||||
*/
|
||||
export function intersectsLineStringArray(flatCoordinates, offset, ends, stride, extent) {
|
||||
@@ -69,7 +69,7 @@ export function intersectsLineStringArray(flatCoordinates, offset, ends, stride,
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("../../extent.js").Extent} extent Extent.
|
||||
* @return {boolean} True if the geometry and the extent intersect.
|
||||
*/
|
||||
export function intersectsLinearRing(flatCoordinates, offset, end, stride, extent) {
|
||||
@@ -98,7 +98,7 @@ export function intersectsLinearRing(flatCoordinates, offset, end, stride, exten
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array<number>} ends Ends.
|
||||
* @param {number} stride Stride.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("../../extent.js").Extent} extent Extent.
|
||||
* @return {boolean} True if the geometry and the extent intersect.
|
||||
*/
|
||||
export function intersectsLinearRingArray(flatCoordinates, offset, ends, stride, extent) {
|
||||
@@ -123,7 +123,7 @@ export function intersectsLinearRingArray(flatCoordinates, offset, ends, stride,
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array<Array<number>>} endss Endss.
|
||||
* @param {number} stride Stride.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("../../extent.js").Extent} extent Extent.
|
||||
* @return {boolean} True if the geometry and the extent intersect.
|
||||
*/
|
||||
export function intersectsLinearRingMultiArray(flatCoordinates, offset, endss, stride, extent) {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {function(this: S, module:ol/coordinate~Coordinate, module:ol/coordinate~Coordinate): T} callback Function
|
||||
* @param {function(this: S, import("../../coordinate.js").Coordinate, import("../../coordinate.js").Coordinate): T} callback Function
|
||||
* called for each segment.
|
||||
* @param {S=} opt_this The object to be used as the value of 'this'
|
||||
* within callback.
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {module:ol/transform~Transform} transform Transform.
|
||||
* @param {import("../../transform.js").Transform} transform Transform.
|
||||
* @param {Array<number>=} opt_dest Destination.
|
||||
* @return {Array<number>} Transformed coordinates.
|
||||
*/
|
||||
|
||||
@@ -80,8 +80,8 @@ export {default as Translate} from './interaction/Translate.js';
|
||||
* * {@link module:ol/interaction/MouseWheelZoom~MouseWheelZoom}
|
||||
* * {@link module:ol/interaction/DragZoom~DragZoom}
|
||||
*
|
||||
* @param {module:ol/interaction~DefaultsOptions=} opt_options Defaults options.
|
||||
* @return {module:ol/Collection<module:ol/interaction/Interaction>}
|
||||
* @param {DefaultsOptions=} opt_options Defaults options.
|
||||
* @return {import("./Collection.js").default<import("./interaction/Interaction.js").default>}
|
||||
* A collection of interactions to be used with the {@link module:ol/Map~Map}
|
||||
* constructor's `interactions` option.
|
||||
* @api
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user