diff --git a/src/ol/format/EsriJSON.js b/src/ol/format/EsriJSON.js index 2a15c14368..f36d1243aa 100644 --- a/src/ol/format/EsriJSON.js +++ b/src/ol/format/EsriJSON.js @@ -102,7 +102,10 @@ class EsriJSON extends JSONFeature { } /** - * @inheritDoc + * @param {Object} object Object. + * @param {import("./Feature.js").ReadOptions=} opt_options Read options. + * @protected + * @return {import("../Feature.js").default} Feature. */ readFeatureFromObject(object, opt_options) { const esriJSONFeature = /** @type {EsriJSONFeature} */ (object); @@ -123,7 +126,10 @@ class EsriJSON extends JSONFeature { } /** - * @inheritDoc + * @param {Object} object Object. + * @param {import("./Feature.js").ReadOptions=} opt_options Read options. + * @protected + * @return {Array} Features. */ readFeaturesFromObject(object, opt_options) { const options = opt_options ? opt_options : {}; @@ -143,14 +149,19 @@ class EsriJSON extends JSONFeature { } /** - * @inheritDoc + * @param {EsriJSONGeometry} object Object. + * @param {import("./Feature.js").ReadOptions=} opt_options Read options. + * @protected + * @return {import("../geom/Geometry.js").default} Geometry. */ readGeometryFromObject(object, opt_options) { - return readGeometry(/** @type {EsriJSONGeometry} */(object), opt_options); + return readGeometry(object, opt_options); } /** - * @inheritDoc + * @param {Object} object Object. + * @protected + * @return {import("../proj/Projection.js").default} Projection. */ readProjectionFromObject(object) { if (object['spatialReference'] && object['spatialReference']['wkid'] !== undefined) { @@ -168,7 +179,6 @@ class EsriJSON extends JSONFeature { * @param {import("../geom/Geometry.js").default} geometry Geometry. * @param {import("./Feature.js").WriteOptions=} opt_options Write options. * @return {EsriJSONGeometry} Object. - * @override * @api */ writeGeometryObject(geometry, opt_options) { @@ -181,7 +191,6 @@ class EsriJSON extends JSONFeature { * @param {import("../Feature.js").default} feature Feature. * @param {import("./Feature.js").WriteOptions=} opt_options Write options. * @return {Object} Object. - * @override * @api */ writeFeatureObject(feature, opt_options) { @@ -212,7 +221,6 @@ class EsriJSON extends JSONFeature { * @param {Array} features Features. * @param {import("./Feature.js").WriteOptions=} opt_options Write options. * @return {EsriJSONFeatureSet} EsriJSON Object. - * @override * @api */ writeFeaturesObject(features, opt_options) { diff --git a/src/ol/format/Feature.js b/src/ol/format/Feature.js index afc8aab5a1..f6d4ec1a13 100644 --- a/src/ol/format/Feature.js +++ b/src/ol/format/Feature.js @@ -81,7 +81,7 @@ class FeatureFormat { /** * Adds the data projection to the read options. - * @param {Document|Node|Object|string} source Source. + * @param {Document|Element|Object|string} source Source. * @param {ReadOptions=} opt_options Options. * @return {ReadOptions|undefined} Options. * @protected @@ -132,7 +132,7 @@ class FeatureFormat { * Read a single feature from a source. * * @abstract - * @param {Document|Node|Object|string} source Source. + * @param {Document|Element|Object|string} source Source. * @param {ReadOptions=} opt_options Read options. * @return {import("../Feature.js").FeatureLike} Feature. */ @@ -144,7 +144,7 @@ class FeatureFormat { * Read all features from a source. * * @abstract - * @param {Document|Node|ArrayBuffer|Object|string} source Source. + * @param {Document|Element|ArrayBuffer|Object|string} source Source. * @param {ReadOptions=} opt_options Read options. * @return {Array} Features. */ @@ -156,7 +156,7 @@ class FeatureFormat { * Read a single geometry from a source. * * @abstract - * @param {Document|Node|Object|string} source Source. + * @param {Document|Element|Object|string} source Source. * @param {ReadOptions=} opt_options Read options. * @return {import("../geom/Geometry.js").default} Geometry. */ @@ -168,7 +168,7 @@ class FeatureFormat { * Read the projection from a source. * * @abstract - * @param {Document|Node|Object|string} source Source. + * @param {Document|Element|Object|string} source Source. * @return {import("../proj/Projection.js").default} Projection. */ readProjection(source) { diff --git a/src/ol/format/GML2.js b/src/ol/format/GML2.js index 596ff706bd..0842d2ac07 100644 --- a/src/ol/format/GML2.js +++ b/src/ol/format/GML2.js @@ -53,7 +53,7 @@ class GML2 extends GMLBase { makeArrayPusher(this.readFeaturesInternal); /** - * @inheritDoc + * @type {string} */ this.schemaLocation = options.schemaLocation ? options.schemaLocation : schemaLocation; diff --git a/src/ol/format/GML3.js b/src/ol/format/GML3.js index e6fd12d07d..b2929794f5 100644 --- a/src/ol/format/GML3.js +++ b/src/ol/format/GML3.js @@ -86,7 +86,7 @@ class GML3 extends GMLBase { options.multiSurface : true; /** - * @inheritDoc + * @type {string} */ this.schemaLocation = options.schemaLocation ? options.schemaLocation : schemaLocation; @@ -866,7 +866,6 @@ class GML3 extends GMLBase { * @param {import("../geom/Geometry.js").default} geometry Geometry. * @param {import("./Feature.js").WriteOptions=} opt_options Options. * @return {Node} Node. - * @override * @api */ writeGeometryNode(geometry, opt_options) { @@ -888,7 +887,6 @@ class GML3 extends GMLBase { * @param {Array} features Features. * @param {import("./Feature.js").WriteOptions=} opt_options Options. * @return {Element} Node. - * @override * @api */ writeFeaturesNode(features, opt_options) { diff --git a/src/ol/format/GML32.js b/src/ol/format/GML32.js index 1cae5f8dd7..777829cecf 100644 --- a/src/ol/format/GML32.js +++ b/src/ol/format/GML32.js @@ -22,7 +22,7 @@ class GML32 extends GML3 { super(options); /** - * @inheritDoc + * @type {string} */ this.schemaLocation = options.schemaLocation ? options.schemaLocation : this.namespace + ' http://schemas.opengis.net/gml/3.2.1/gml.xsd'; diff --git a/src/ol/format/GMLBase.js b/src/ol/format/GMLBase.js index d0f5c7b05a..c3a726a484 100644 --- a/src/ol/format/GMLBase.js +++ b/src/ol/format/GMLBase.js @@ -470,7 +470,10 @@ class GMLBase extends XMLFeature { } /** - * @inheritDoc + * @param {Element} node Node. + * @param {import("./Feature.js").ReadOptions=} opt_options Options. + * @protected + * @return {import("../geom/Geometry.js").default|import("../extent.js").Extent} Geometry. */ //@ts-ignore readGeometryFromNode(node, opt_options) { @@ -480,7 +483,9 @@ class GMLBase extends XMLFeature { } /** - * @inheritDoc + * @param {Element} node Node. + * @param {import("./Feature.js").ReadOptions=} opt_options Options. + * @return {Array} Features. */ readFeaturesFromNode(node, opt_options) { const options = { @@ -495,7 +500,8 @@ class GMLBase extends XMLFeature { } /** - * @inheritDoc + * @param {Element} node Node. + * @return {import("../proj/Projection.js").default} Projection. */ readProjectionFromNode(node) { return getProjection(this.srsName ? this.srsName : node.firstElementChild.getAttribute('srsName')); diff --git a/src/ol/format/GPX.js b/src/ol/format/GPX.js index ec56119232..d1be09df7b 100644 --- a/src/ol/format/GPX.js +++ b/src/ol/format/GPX.js @@ -130,7 +130,7 @@ class GPX extends XMLFeature { /** - * @inheritDoc + * @type {import("../proj/Projection.js").default} */ this.dataProjection = getProjection('EPSG:4326'); @@ -160,7 +160,9 @@ class GPX extends XMLFeature { } /** - * @inheritDoc + * @param {Element} node Node. + * @param {import("./Feature.js").ReadOptions=} opt_options Options. + * @return {import("../Feature.js").default} Feature. */ readFeatureFromNode(node, opt_options) { if (!includes(NAMESPACE_URIS, node.namespaceURI)) { @@ -179,7 +181,9 @@ class GPX extends XMLFeature { } /** - * @inheritDoc + * @param {Element} node Node. + * @param {import("./Feature.js").ReadOptions=} opt_options Options. + * @return {Array} Features. */ readFeaturesFromNode(node, opt_options) { if (!includes(NAMESPACE_URIS, node.namespaceURI)) { @@ -207,7 +211,6 @@ class GPX extends XMLFeature { * @param {Array} features Features. * @param {import("./Feature.js").WriteOptions=} opt_options Options. * @return {Node} Node. - * @override * @api */ writeFeaturesNode(features, opt_options) { diff --git a/src/ol/format/GeoJSON.js b/src/ol/format/GeoJSON.js index 2e3f30dee2..0ea2a67ee9 100644 --- a/src/ol/format/GeoJSON.js +++ b/src/ol/format/GeoJSON.js @@ -63,7 +63,7 @@ class GeoJSON extends JSONFeature { super(); /** - * @inheritDoc + * @type {import("../proj/Projection.js").default} */ this.dataProjection = getProjection( options.dataProjection ? @@ -90,7 +90,10 @@ class GeoJSON extends JSONFeature { } /** - * @inheritDoc + * @param {Object} object Object. + * @param {import("./Feature.js").ReadOptions=} opt_options Read options. + * @protected + * @return {import("../Feature.js").default} Feature. */ readFeatureFromObject(object, opt_options) { /** @@ -127,7 +130,10 @@ class GeoJSON extends JSONFeature { } /** - * @inheritDoc + * @param {Object} object Object. + * @param {import("./Feature.js").ReadOptions=} opt_options Read options. + * @protected + * @return {Array} Features. */ readFeaturesFromObject(object, opt_options) { const geoJSONObject = /** @type {GeoJSONObject} */ (object); @@ -147,14 +153,19 @@ class GeoJSON extends JSONFeature { } /** - * @inheritDoc + * @param {GeoJSONGeometry} object Object. + * @param {import("./Feature.js").ReadOptions=} opt_options Read options. + * @protected + * @return {import("../geom/Geometry.js").default} Geometry. */ readGeometryFromObject(object, opt_options) { - return readGeometry(/** @type {GeoJSONGeometry} */ (object), opt_options); + return readGeometry(object, opt_options); } /** - * @inheritDoc + * @param {Object} object Object. + * @protected + * @return {import("../proj/Projection.js").default} Projection. */ readProjectionFromObject(object) { const crs = object['crs']; @@ -181,7 +192,6 @@ class GeoJSON extends JSONFeature { * @param {import("../Feature.js").default} feature Feature. * @param {import("./Feature.js").WriteOptions=} opt_options Write options. * @return {GeoJSONFeature} Object. - * @override * @api */ writeFeatureObject(feature, opt_options) { @@ -218,7 +228,6 @@ class GeoJSON extends JSONFeature { * @param {Array} features Features. * @param {import("./Feature.js").WriteOptions=} opt_options Write options. * @return {GeoJSONFeatureCollection} GeoJSON Object. - * @override * @api */ writeFeaturesObject(features, opt_options) { @@ -239,7 +248,6 @@ class GeoJSON extends JSONFeature { * @param {import("../geom/Geometry.js").default} geometry Geometry. * @param {import("./Feature.js").WriteOptions=} opt_options Write options. * @return {GeoJSONGeometry|GeoJSONGeometryCollection} Object. - * @override * @api */ writeGeometryObject(geometry, opt_options) { diff --git a/src/ol/format/IGC.js b/src/ol/format/IGC.js index fb2d71f306..3c46e8af47 100644 --- a/src/ol/format/IGC.js +++ b/src/ol/format/IGC.js @@ -77,7 +77,7 @@ class IGC extends TextFeature { const options = opt_options ? opt_options : {}; /** - * @inheritDoc + * @type {import("../proj/Projection.js").default} */ this.dataProjection = getProjection('EPSG:4326'); @@ -89,7 +89,10 @@ class IGC extends TextFeature { } /** - * @inheritDoc + * @protected + * @param {string} text Text. + * @param {import("./Feature.js").ReadOptions=} opt_options Read options. + * @return {import("../Feature.js").default} Feature. */ readFeatureFromText(text, opt_options) { const altitudeMode = this.altitudeMode_; @@ -164,7 +167,10 @@ class IGC extends TextFeature { } /** - * @inheritDoc + * @param {string} text Text. + * @param {import("./Feature.js").ReadOptions=} opt_options Read options. + * @protected + * @return {Array} Features. */ readFeaturesFromText(text, opt_options) { const feature = this.readFeatureFromText(text, opt_options); diff --git a/src/ol/format/JSONFeature.js b/src/ol/format/JSONFeature.js index 2186befc84..483c192752 100644 --- a/src/ol/format/JSONFeature.js +++ b/src/ol/format/JSONFeature.js @@ -19,7 +19,7 @@ class JSONFeature extends FeatureFormat { } /** - * @inheritDoc + * @return {import("./FormatType.js").default} Format. */ getType() { return FormatType.JSON; @@ -29,7 +29,7 @@ class JSONFeature extends FeatureFormat { * Read a feature. Only works for a single feature. Use `readFeatures` to * read a feature collection. * - * @param {ArrayBuffer|Document|Node|Object|string} source Source. + * @param {ArrayBuffer|Document|Element|Object|string} source Source. * @param {import("./Feature.js").ReadOptions=} opt_options Read options. * @return {import("../Feature.js").default} Feature. * @api @@ -43,7 +43,7 @@ class JSONFeature extends FeatureFormat { * Read all features. Works with both a single feature and a feature * collection. * - * @param {ArrayBuffer|Document|Node|Object|string} source Source. + * @param {ArrayBuffer|Document|Element|Object|string} source Source. * @param {import("./Feature.js").ReadOptions=} opt_options Read options. * @return {Array} Features. * @api @@ -78,7 +78,7 @@ class JSONFeature extends FeatureFormat { /** * Read a geometry. * - * @param {ArrayBuffer|Document|Node|Object|string} source Source. + * @param {ArrayBuffer|Document|Element|Object|string} source Source. * @param {import("./Feature.js").ReadOptions=} opt_options Read options. * @return {import("../geom/Geometry.js").default} Geometry. * @api @@ -102,7 +102,7 @@ class JSONFeature extends FeatureFormat { /** * Read the projection. * - * @param {ArrayBuffer|Document|Node|Object|string} source Source. + * @param {ArrayBuffer|Document|Element|Object|string} source Source. * @return {import("../proj/Projection.js").default} Projection. * @api */ @@ -189,7 +189,7 @@ class JSONFeature extends FeatureFormat { /** - * @param {Document|Node|Object|string} source Source. + * @param {Document|Element|Object|string} source Source. * @return {Object} Object. */ function getObject(source) { diff --git a/src/ol/format/KML.js b/src/ol/format/KML.js index 7cbe238247..1c1608d935 100644 --- a/src/ol/format/KML.js +++ b/src/ol/format/KML.js @@ -427,7 +427,7 @@ class KML extends XMLFeature { } /** - * @inheritDoc + * @type {import("../proj/Projection.js").default} */ this.dataProjection = getProjection('EPSG:4326'); @@ -598,7 +598,9 @@ class KML extends XMLFeature { } /** - * @inheritDoc + * @param {Element} node Node. + * @param {import("./Feature.js").ReadOptions=} opt_options Options. + * @return {import("../Feature.js").default} Feature. */ readFeatureFromNode(node, opt_options) { if (!includes(NAMESPACE_URIS, node.namespaceURI)) { @@ -614,7 +616,10 @@ class KML extends XMLFeature { } /** - * @inheritDoc + * @protected + * @param {Element} node Node. + * @param {import("./Feature.js").ReadOptions=} opt_options Options. + * @return {Array} Features. */ readFeaturesFromNode(node, opt_options) { if (!includes(NAMESPACE_URIS, node.namespaceURI)) { @@ -847,7 +852,6 @@ class KML extends XMLFeature { * @param {Array} features Features. * @param {import("./Feature.js").WriteOptions=} opt_options Options. * @return {Node} Node. - * @override * @api */ writeFeaturesNode(features, opt_options) { diff --git a/src/ol/format/MVT.js b/src/ol/format/MVT.js index c8c8e2c77e..40c80480e7 100644 --- a/src/ol/format/MVT.js +++ b/src/ol/format/MVT.js @@ -234,7 +234,7 @@ class MVT extends FeatureFormat { } /** - * @inheritDoc + * @return {import("./FormatType.js").default} Format. */ getType() { return FormatType.ARRAY_BUFFER; @@ -277,7 +277,10 @@ class MVT extends FeatureFormat { } /** - * @inheritDoc + * Read the projection from the source. + * + * @param {Document|Element|Object|string} source Source. + * @return {import("../proj/Projection.js").default} Projection. * @api */ readProjection(source) { diff --git a/src/ol/format/OSMXML.js b/src/ol/format/OSMXML.js index d74ddd2aa2..cef247f8a6 100644 --- a/src/ol/format/OSMXML.js +++ b/src/ol/format/OSMXML.js @@ -58,13 +58,16 @@ class OSMXML extends XMLFeature { super(); /** - * @inheritDoc + * @type {import("../proj/Projection.js").default} */ this.dataProjection = getProjection('EPSG:4326'); } /** - * @inheritDoc + * @protected + * @param {Element} node Node. + * @param {import("./Feature.js").ReadOptions=} opt_options Options. + * @return {Array} Features. */ readFeaturesFromNode(node, opt_options) { const options = this.getReadOptions(node, opt_options); diff --git a/src/ol/format/OWS.js b/src/ol/format/OWS.js index 1c4578afa9..e9dd976dd8 100644 --- a/src/ol/format/OWS.js +++ b/src/ol/format/OWS.js @@ -33,19 +33,21 @@ class OWS extends XML { } /** - * @inheritDoc + * @param {Document} doc Document. + * @return {Object} Object */ readFromDocument(doc) { for (let n = doc.firstChild; n; n = n.nextSibling) { if (n.nodeType == Node.ELEMENT_NODE) { - return this.readFromNode(n); + return this.readFromNode(/** @type {Element} */ (n)); } } return null; } /** - * @inheritDoc + * @param {Element} node Node. + * @return {Object} Object */ readFromNode(node) { const owsObject = pushParseAndPop({}, diff --git a/src/ol/format/Polyline.js b/src/ol/format/Polyline.js index d28f2c4e2f..8900422cd5 100644 --- a/src/ol/format/Polyline.js +++ b/src/ol/format/Polyline.js @@ -47,7 +47,7 @@ class Polyline extends TextFeature { /** - * @inheritDoc + * @type {import("../proj/Projection.js").default} */ this.dataProjection = getProjection('EPSG:4326'); @@ -66,7 +66,10 @@ class Polyline extends TextFeature { } /** - * @inheritDoc + * @protected + * @param {string} text Text. + * @param {import("./Feature.js").ReadOptions=} opt_options Read options. + * @return {import("../Feature.js").default} Feature. */ readFeatureFromText(text, opt_options) { const geometry = this.readGeometryFromText(text, opt_options); @@ -74,7 +77,10 @@ class Polyline extends TextFeature { } /** - * @inheritDoc + * @param {string} text Text. + * @param {import("./Feature.js").ReadOptions=} opt_options Read options. + * @protected + * @return {Array} Features. */ readFeaturesFromText(text, opt_options) { const feature = this.readFeatureFromText(text, opt_options); @@ -82,7 +88,10 @@ class Polyline extends TextFeature { } /** - * @inheritDoc + * @param {string} text Text. + * @param {import("./Feature.js").ReadOptions=} opt_options Read options. + * @protected + * @return {import("../geom/Geometry.js").default} Geometry. */ readGeometryFromText(text, opt_options) { const stride = getStrideForLayout(this.geometryLayout_); @@ -95,7 +104,10 @@ class Polyline extends TextFeature { } /** - * @inheritDoc + * @param {import("../Feature.js").default} feature Features. + * @param {import("./Feature.js").WriteOptions=} opt_options Write options. + * @protected + * @return {string} Text. */ writeFeatureText(feature, opt_options) { const geometry = feature.getGeometry(); @@ -108,14 +120,20 @@ class Polyline extends TextFeature { } /** - * @inheritDoc + * @param {Array} features Features. + * @param {import("./Feature.js").WriteOptions=} opt_options Write options. + * @protected + * @return {string} Text. */ writeFeaturesText(features, opt_options) { return this.writeFeatureText(features[0], opt_options); } /** - * @inheritDoc + * @param {LineString} geometry Geometry. + * @param {import("./Feature.js").WriteOptions=} opt_options Write options. + * @protected + * @return {string} Text. */ writeGeometryText(geometry, opt_options) { geometry = /** @type {LineString} */ diff --git a/src/ol/format/TextFeature.js b/src/ol/format/TextFeature.js index 926ae832e4..c1f40290d7 100644 --- a/src/ol/format/TextFeature.js +++ b/src/ol/format/TextFeature.js @@ -19,7 +19,7 @@ class TextFeature extends FeatureFormat { } /** - * @inheritDoc + * @return {import("./FormatType.js").default} Format. */ getType() { return FormatType.TEXT; @@ -28,7 +28,7 @@ class TextFeature extends FeatureFormat { /** * Read the feature from the source. * - * @param {Document|Node|Object|string} source Source. + * @param {Document|Element|Object|string} source Source. * @param {import("./Feature.js").ReadOptions=} opt_options Read options. * @return {import("../Feature.js").default} Feature. * @api @@ -51,7 +51,7 @@ class TextFeature extends FeatureFormat { /** * Read the features from the source. * - * @param {Document|Node|Object|string} source Source. + * @param {Document|Element|Object|string} source Source. * @param {import("./Feature.js").ReadOptions=} opt_options Read options. * @return {Array} Features. * @api @@ -74,7 +74,7 @@ class TextFeature extends FeatureFormat { /** * Read the geometry from the source. * - * @param {Document|Node|Object|string} source Source. + * @param {Document|Element|Object|string} source Source. * @param {import("./Feature.js").ReadOptions=} opt_options Read options. * @return {import("../geom/Geometry.js").default} Geometry. * @api @@ -97,7 +97,7 @@ class TextFeature extends FeatureFormat { /** * Read the projection from the source. * - * @param {Document|Node|Object|string} source Source. + * @param {Document|Element|Object|string} source Source. * @return {import("../proj/Projection.js").default} Projection. * @api */ @@ -186,7 +186,7 @@ class TextFeature extends FeatureFormat { /** - * @param {Document|Node|Object|string} source Source. + * @param {Document|Element|Object|string} source Source. * @return {string} Text. */ function getText(source) { diff --git a/src/ol/format/TopoJSON.js b/src/ol/format/TopoJSON.js index c8cc330cf7..37d3d7bcb9 100644 --- a/src/ol/format/TopoJSON.js +++ b/src/ol/format/TopoJSON.js @@ -78,7 +78,7 @@ class TopoJSON extends JSONFeature { this.layers_ = options.layers ? options.layers : null; /** - * @inheritDoc + * @type {import("../proj/Projection.js").default} */ this.dataProjection = getProjection( options.dataProjection ? @@ -87,7 +87,10 @@ class TopoJSON extends JSONFeature { } /** - * @inheritDoc + * @param {Object} object Object. + * @param {import("./Feature.js").ReadOptions=} opt_options Read options. + * @protected + * @return {Array} Features. */ readFeaturesFromObject(object, opt_options) { if (object.type == 'Topology') { @@ -128,7 +131,9 @@ class TopoJSON extends JSONFeature { } /** - * @inheritDoc + * @param {Object} object Object. + * @protected + * @return {import("../proj/Projection.js").default} Projection. */ readProjectionFromObject(object) { return this.dataProjection; diff --git a/src/ol/format/WFS.js b/src/ol/format/WFS.js index e3cd863db2..435dc870e9 100644 --- a/src/ol/format/WFS.js +++ b/src/ol/format/WFS.js @@ -254,7 +254,10 @@ class WFS extends XMLFeature { } /** - * @inheritDoc + * @protected + * @param {Element} node Node. + * @param {import("./Feature.js").ReadOptions=} opt_options Options. + * @return {Array} Features. */ readFeaturesFromNode(node, opt_options) { /** @type {import("../xml.js").NodeStackItem} */ @@ -513,19 +516,21 @@ class WFS extends XMLFeature { } /** - * @inheritDoc + * @param {Document} doc Document. + * @return {import("../proj/Projection.js").default} Projection. */ readProjectionFromDocument(doc) { - for (let n = /** @type {Node} */ (doc.firstChild); n; n = n.nextSibling) { + for (let n = doc.firstChild; n; n = n.nextSibling) { if (n.nodeType == Node.ELEMENT_NODE) { - return this.readProjectionFromNode(n); + return this.readProjectionFromNode(/** @type {Element} */ (n)); } } return null; } /** - * @inheritDoc + * @param {Element} node Node. + * @return {import("../proj/Projection.js").default} Projection. */ readProjectionFromNode(node) { if (node.firstElementChild && diff --git a/src/ol/format/WKT.js b/src/ol/format/WKT.js index c4c6ad2eb2..20660e484f 100644 --- a/src/ol/format/WKT.js +++ b/src/ol/format/WKT.js @@ -642,7 +642,10 @@ class WKT extends TextFeature { } /** - * @inheritDoc + * @protected + * @param {string} text Text. + * @param {import("./Feature.js").ReadOptions=} opt_options Read options. + * @return {import("../Feature.js").default} Feature. */ readFeatureFromText(text, opt_options) { const geom = this.readGeometryFromText(text, opt_options); @@ -655,7 +658,10 @@ class WKT extends TextFeature { } /** - * @inheritDoc + * @param {string} text Text. + * @param {import("./Feature.js").ReadOptions=} opt_options Read options. + * @protected + * @return {Array} Features. */ readFeaturesFromText(text, opt_options) { let geometries = []; @@ -677,7 +683,10 @@ class WKT extends TextFeature { } /** - * @inheritDoc + * @param {string} text Text. + * @param {import("./Feature.js").ReadOptions=} opt_options Read options. + * @protected + * @return {import("../geom/Geometry.js").default} Geometry. */ readGeometryFromText(text, opt_options) { const geometry = this.parse_(text); @@ -689,7 +698,10 @@ class WKT extends TextFeature { } /** - * @inheritDoc + * @param {import("../Feature.js").default} feature Features. + * @param {import("./Feature.js").WriteOptions=} opt_options Write options. + * @protected + * @return {string} Text. */ writeFeatureText(feature, opt_options) { const geometry = feature.getGeometry(); @@ -700,7 +712,10 @@ class WKT extends TextFeature { } /** - * @inheritDoc + * @param {Array} features Features. + * @param {import("./Feature.js").WriteOptions=} opt_options Write options. + * @protected + * @return {string} Text. */ writeFeaturesText(features, opt_options) { if (features.length == 1) { @@ -715,7 +730,10 @@ class WKT extends TextFeature { } /** - * @inheritDoc + * @param {import("../geom/Geometry.js").default} geometry Geometry. + * @param {import("./Feature.js").WriteOptions=} opt_options Write options. + * @protected + * @return {string} Text. */ writeGeometryText(geometry, opt_options) { return encode(transformGeometryWithOptions(geometry, true, opt_options)); diff --git a/src/ol/format/WMSCapabilities.js b/src/ol/format/WMSCapabilities.js index 7dda2be9de..82b5874383 100644 --- a/src/ol/format/WMSCapabilities.js +++ b/src/ol/format/WMSCapabilities.js @@ -60,19 +60,21 @@ class WMSCapabilities extends XML { } /** - * @inheritDoc + * @param {Document} doc Document. + * @return {Object} Object */ readFromDocument(doc) { for (let n = doc.firstChild; n; n = n.nextSibling) { if (n.nodeType == Node.ELEMENT_NODE) { - return this.readFromNode(n); + return this.readFromNode(/** @type {Element} */ (n)); } } return null; } /** - * @inheritDoc + * @param {Element} node Node. + * @return {Object} Object */ readFromNode(node) { this.version = node.getAttribute('version').trim(); diff --git a/src/ol/format/WMSGetFeatureInfo.js b/src/ol/format/WMSGetFeatureInfo.js index f63f88cb54..ccc8e2a136 100644 --- a/src/ol/format/WMSGetFeatureInfo.js +++ b/src/ol/format/WMSGetFeatureInfo.js @@ -144,7 +144,10 @@ class WMSGetFeatureInfo extends XMLFeature { } /** - * @inheritDoc + * @protected + * @param {Element} node Node. + * @param {import("./Feature.js").ReadOptions=} opt_options Options. + * @return {Array} Features. */ readFeaturesFromNode(node, opt_options) { const options = {}; diff --git a/src/ol/format/WMTSCapabilities.js b/src/ol/format/WMTSCapabilities.js index bd1629f1d7..cfdcdd8cb4 100644 --- a/src/ol/format/WMTSCapabilities.js +++ b/src/ol/format/WMTSCapabilities.js @@ -59,19 +59,21 @@ class WMTSCapabilities extends XML { } /** - * @inheritDoc + * @param {Document} doc Document. + * @return {Object} Object */ readFromDocument(doc) { for (let n = doc.firstChild; n; n = n.nextSibling) { if (n.nodeType == Node.ELEMENT_NODE) { - return this.readFromNode(n); + return this.readFromNode(/** @type {Element} */ (n)); } } return null; } /** - * @inheritDoc + * @param {Element} node Node. + * @return {Object} Object */ readFromNode(node) { let version = node.getAttribute('version'); diff --git a/src/ol/format/XMLFeature.js b/src/ol/format/XMLFeature.js index 0f413e21c3..550b78dca7 100644 --- a/src/ol/format/XMLFeature.js +++ b/src/ol/format/XMLFeature.js @@ -27,7 +27,7 @@ class XMLFeature extends FeatureFormat { } /** - * @inheritDoc + * @return {import("./FormatType.js").default} Format. */ getType() { return FormatType.XML; @@ -36,7 +36,7 @@ class XMLFeature extends FeatureFormat { /** * Read a single feature. * - * @param {Document|Node|Object|string} source Source. + * @param {Document|Element|Object|string} source Source. * @param {import("./Feature.js").ReadOptions=} opt_options Read options. * @return {import("../Feature.js").default} Feature. * @api @@ -50,7 +50,7 @@ class XMLFeature extends FeatureFormat { } else if (isDocument(source)) { return this.readFeatureFromDocument(/** @type {Document} */ (source), opt_options); } else { - return this.readFeatureFromNode(/** @type {Node} */ (source), opt_options); + return this.readFeatureFromNode(/** @type {Element} */ (source), opt_options); } } @@ -69,7 +69,7 @@ class XMLFeature extends FeatureFormat { } /** - * @param {Node} node Node. + * @param {Element} node Node. * @param {import("./Feature.js").ReadOptions=} opt_options Options. * @return {import("../Feature.js").default} Feature. */ @@ -80,7 +80,7 @@ class XMLFeature extends FeatureFormat { /** * Read all features from a feature collection. * - * @param {Document|Node|Object|string} source Source. + * @param {Document|Element|Object|string} source Source. * @param {import("./Feature.js").ReadOptions=} opt_options Options. * @return {Array} Features. * @api @@ -95,7 +95,7 @@ class XMLFeature extends FeatureFormat { return this.readFeaturesFromDocument( /** @type {Document} */ (source), opt_options); } else { - return this.readFeaturesFromNode(/** @type {Node} */ (source), opt_options); + return this.readFeaturesFromNode(/** @type {Element} */ (source), opt_options); } } @@ -108,9 +108,9 @@ class XMLFeature extends FeatureFormat { readFeaturesFromDocument(doc, opt_options) { /** @type {Array} */ const features = []; - for (let n = /** @type {Node} */ (doc.firstChild); n; n = n.nextSibling) { + for (let n = doc.firstChild; n; n = n.nextSibling) { if (n.nodeType == Node.ELEMENT_NODE) { - extend(features, this.readFeaturesFromNode(n, opt_options)); + extend(features, this.readFeaturesFromNode(/** @type {Element} */ (n), opt_options)); } } return features; @@ -118,7 +118,7 @@ class XMLFeature extends FeatureFormat { /** * @abstract - * @param {Node} node Node. + * @param {Element} node Node. * @param {import("./Feature.js").ReadOptions=} opt_options Options. * @protected * @return {Array} Features. @@ -128,7 +128,11 @@ class XMLFeature extends FeatureFormat { } /** - * @inheritDoc + * Read a single geometry from a source. + * + * @param {Document|Element|Object|string} source Source. + * @param {import("./Feature.js").ReadOptions=} opt_options Read options. + * @return {import("../geom/Geometry.js").default} Geometry. */ readGeometry(source, opt_options) { if (!source) { @@ -140,7 +144,7 @@ class XMLFeature extends FeatureFormat { return this.readGeometryFromDocument( /** @type {Document} */ (source), opt_options); } else { - return this.readGeometryFromNode(/** @type {Node} */ (source), opt_options); + return this.readGeometryFromNode(/** @type {Element} */ (source), opt_options); } } @@ -155,7 +159,7 @@ class XMLFeature extends FeatureFormat { } /** - * @param {Node} node Node. + * @param {Element} node Node. * @param {import("./Feature.js").ReadOptions=} opt_options Options. * @protected * @return {import("../geom/Geometry.js").default} Geometry. @@ -167,7 +171,7 @@ class XMLFeature extends FeatureFormat { /** * Read the projection from the source. * - * @param {Document|Node|Object|string} source Source. + * @param {Document|Element|Object|string} source Source. * @return {import("../proj/Projection.js").default} Projection. * @api */ @@ -180,7 +184,7 @@ class XMLFeature extends FeatureFormat { } else if (isDocument(source)) { return this.readProjectionFromDocument(/** @type {Document} */ (source)); } else { - return this.readProjectionFromNode(/** @type {Node} */ (source)); + return this.readProjectionFromNode(/** @type {Element} */ (source)); } } @@ -194,7 +198,7 @@ class XMLFeature extends FeatureFormat { } /** - * @param {Node} node Node. + * @param {Element} node Node. * @protected * @return {import("../proj/Projection.js").default} Projection. */ @@ -203,7 +207,11 @@ class XMLFeature extends FeatureFormat { } /** - * @inheritDoc + * Encode a feature as string. + * + * @param {import("../Feature.js").default} feature Feature. + * @param {import("./Feature.js").WriteOptions=} opt_options Write options. + * @return {string} Encoded feature. */ writeFeature(feature, opt_options) { const node = this.writeFeatureNode(feature, opt_options); @@ -243,7 +251,11 @@ class XMLFeature extends FeatureFormat { } /** - * @inheritDoc + * Encode a geometry as string. + * + * @param {import("../geom/Geometry.js").default} geometry Geometry. + * @param {import("./Feature.js").WriteOptions=} opt_options Write options. + * @return {string} Encoded geometry. */ writeGeometry(geometry, opt_options) { const node = this.writeGeometryNode(geometry, opt_options);