Transformed types
Using the [ts.js codemod](https://gist.github.com/tschaub/1ea498c9d1e5268cf36d212b3949be4e): jscodeshift --transform ts.js src
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user