Remove all inheritDoc tags from src/ol/format
This commit is contained in:
@@ -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) {
|
readFeatureFromObject(object, opt_options) {
|
||||||
const esriJSONFeature = /** @type {EsriJSONFeature} */ (object);
|
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<Feature>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromObject(object, opt_options) {
|
readFeaturesFromObject(object, opt_options) {
|
||||||
const options = opt_options ? 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) {
|
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) {
|
readProjectionFromObject(object) {
|
||||||
if (object['spatialReference'] && object['spatialReference']['wkid'] !== undefined) {
|
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("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {EsriJSONGeometry} Object.
|
* @return {EsriJSONGeometry} Object.
|
||||||
* @override
|
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
writeGeometryObject(geometry, opt_options) {
|
writeGeometryObject(geometry, opt_options) {
|
||||||
@@ -181,7 +191,6 @@ class EsriJSON extends JSONFeature {
|
|||||||
* @param {import("../Feature.js").default} feature Feature.
|
* @param {import("../Feature.js").default} feature Feature.
|
||||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {Object} Object.
|
* @return {Object} Object.
|
||||||
* @override
|
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
writeFeatureObject(feature, opt_options) {
|
writeFeatureObject(feature, opt_options) {
|
||||||
@@ -212,7 +221,6 @@ class EsriJSON extends JSONFeature {
|
|||||||
* @param {Array<import("../Feature.js").default>} features Features.
|
* @param {Array<import("../Feature.js").default>} features Features.
|
||||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {EsriJSONFeatureSet} EsriJSON Object.
|
* @return {EsriJSONFeatureSet} EsriJSON Object.
|
||||||
* @override
|
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
writeFeaturesObject(features, opt_options) {
|
writeFeaturesObject(features, opt_options) {
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ class FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the data projection to the read options.
|
* 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.
|
* @param {ReadOptions=} opt_options Options.
|
||||||
* @return {ReadOptions|undefined} Options.
|
* @return {ReadOptions|undefined} Options.
|
||||||
* @protected
|
* @protected
|
||||||
@@ -132,7 +132,7 @@ class FeatureFormat {
|
|||||||
* Read a single feature from a source.
|
* Read a single feature from a source.
|
||||||
*
|
*
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Element|Object|string} source Source.
|
||||||
* @param {ReadOptions=} opt_options Read options.
|
* @param {ReadOptions=} opt_options Read options.
|
||||||
* @return {import("../Feature.js").FeatureLike} Feature.
|
* @return {import("../Feature.js").FeatureLike} Feature.
|
||||||
*/
|
*/
|
||||||
@@ -144,7 +144,7 @@ class FeatureFormat {
|
|||||||
* Read all features from a source.
|
* Read all features from a source.
|
||||||
*
|
*
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {Document|Node|ArrayBuffer|Object|string} source Source.
|
* @param {Document|Element|ArrayBuffer|Object|string} source Source.
|
||||||
* @param {ReadOptions=} opt_options Read options.
|
* @param {ReadOptions=} opt_options Read options.
|
||||||
* @return {Array<import("../Feature.js").FeatureLike>} Features.
|
* @return {Array<import("../Feature.js").FeatureLike>} Features.
|
||||||
*/
|
*/
|
||||||
@@ -156,7 +156,7 @@ class FeatureFormat {
|
|||||||
* Read a single geometry from a source.
|
* Read a single geometry from a source.
|
||||||
*
|
*
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Element|Object|string} source Source.
|
||||||
* @param {ReadOptions=} opt_options Read options.
|
* @param {ReadOptions=} opt_options Read options.
|
||||||
* @return {import("../geom/Geometry.js").default} Geometry.
|
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||||
*/
|
*/
|
||||||
@@ -168,7 +168,7 @@ class FeatureFormat {
|
|||||||
* Read the projection from a source.
|
* Read the projection from a source.
|
||||||
*
|
*
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Element|Object|string} source Source.
|
||||||
* @return {import("../proj/Projection.js").default} Projection.
|
* @return {import("../proj/Projection.js").default} Projection.
|
||||||
*/
|
*/
|
||||||
readProjection(source) {
|
readProjection(source) {
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class GML2 extends GMLBase {
|
|||||||
makeArrayPusher(this.readFeaturesInternal);
|
makeArrayPusher(this.readFeaturesInternal);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
this.schemaLocation = options.schemaLocation ?
|
this.schemaLocation = options.schemaLocation ?
|
||||||
options.schemaLocation : schemaLocation;
|
options.schemaLocation : schemaLocation;
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class GML3 extends GMLBase {
|
|||||||
options.multiSurface : true;
|
options.multiSurface : true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
this.schemaLocation = options.schemaLocation ?
|
this.schemaLocation = options.schemaLocation ?
|
||||||
options.schemaLocation : schemaLocation;
|
options.schemaLocation : schemaLocation;
|
||||||
@@ -866,7 +866,6 @@ class GML3 extends GMLBase {
|
|||||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
* @override
|
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
writeGeometryNode(geometry, opt_options) {
|
writeGeometryNode(geometry, opt_options) {
|
||||||
@@ -888,7 +887,6 @@ class GML3 extends GMLBase {
|
|||||||
* @param {Array<import("../Feature.js").default>} features Features.
|
* @param {Array<import("../Feature.js").default>} features Features.
|
||||||
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||||
* @return {Element} Node.
|
* @return {Element} Node.
|
||||||
* @override
|
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
writeFeaturesNode(features, opt_options) {
|
writeFeaturesNode(features, opt_options) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class GML32 extends GML3 {
|
|||||||
super(options);
|
super(options);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
this.schemaLocation = options.schemaLocation ?
|
this.schemaLocation = options.schemaLocation ?
|
||||||
options.schemaLocation : this.namespace + ' http://schemas.opengis.net/gml/3.2.1/gml.xsd';
|
options.schemaLocation : this.namespace + ' http://schemas.opengis.net/gml/3.2.1/gml.xsd';
|
||||||
|
|||||||
@@ -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
|
//@ts-ignore
|
||||||
readGeometryFromNode(node, opt_options) {
|
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<import("../Feature.js").default>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromNode(node, opt_options) {
|
readFeaturesFromNode(node, opt_options) {
|
||||||
const 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) {
|
readProjectionFromNode(node) {
|
||||||
return getProjection(this.srsName ? this.srsName : node.firstElementChild.getAttribute('srsName'));
|
return getProjection(this.srsName ? this.srsName : node.firstElementChild.getAttribute('srsName'));
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ class GPX extends XMLFeature {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @type {import("../proj/Projection.js").default}
|
||||||
*/
|
*/
|
||||||
this.dataProjection = getProjection('EPSG:4326');
|
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) {
|
readFeatureFromNode(node, opt_options) {
|
||||||
if (!includes(NAMESPACE_URIS, node.namespaceURI)) {
|
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<import("../Feature.js").default>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromNode(node, opt_options) {
|
readFeaturesFromNode(node, opt_options) {
|
||||||
if (!includes(NAMESPACE_URIS, node.namespaceURI)) {
|
if (!includes(NAMESPACE_URIS, node.namespaceURI)) {
|
||||||
@@ -207,7 +211,6 @@ class GPX extends XMLFeature {
|
|||||||
* @param {Array<Feature>} features Features.
|
* @param {Array<Feature>} features Features.
|
||||||
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
* @override
|
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
writeFeaturesNode(features, opt_options) {
|
writeFeaturesNode(features, opt_options) {
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class GeoJSON extends JSONFeature {
|
|||||||
super();
|
super();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @type {import("../proj/Projection.js").default}
|
||||||
*/
|
*/
|
||||||
this.dataProjection = getProjection(
|
this.dataProjection = getProjection(
|
||||||
options.dataProjection ?
|
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) {
|
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<Feature>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromObject(object, opt_options) {
|
readFeaturesFromObject(object, opt_options) {
|
||||||
const geoJSONObject = /** @type {GeoJSONObject} */ (object);
|
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) {
|
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) {
|
readProjectionFromObject(object) {
|
||||||
const crs = object['crs'];
|
const crs = object['crs'];
|
||||||
@@ -181,7 +192,6 @@ class GeoJSON extends JSONFeature {
|
|||||||
* @param {import("../Feature.js").default} feature Feature.
|
* @param {import("../Feature.js").default} feature Feature.
|
||||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONFeature} Object.
|
* @return {GeoJSONFeature} Object.
|
||||||
* @override
|
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
writeFeatureObject(feature, opt_options) {
|
writeFeatureObject(feature, opt_options) {
|
||||||
@@ -218,7 +228,6 @@ class GeoJSON extends JSONFeature {
|
|||||||
* @param {Array<import("../Feature.js").default>} features Features.
|
* @param {Array<import("../Feature.js").default>} features Features.
|
||||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONFeatureCollection} GeoJSON Object.
|
* @return {GeoJSONFeatureCollection} GeoJSON Object.
|
||||||
* @override
|
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
writeFeaturesObject(features, opt_options) {
|
writeFeaturesObject(features, opt_options) {
|
||||||
@@ -239,7 +248,6 @@ class GeoJSON extends JSONFeature {
|
|||||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometry|GeoJSONGeometryCollection} Object.
|
* @return {GeoJSONGeometry|GeoJSONGeometryCollection} Object.
|
||||||
* @override
|
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
writeGeometryObject(geometry, opt_options) {
|
writeGeometryObject(geometry, opt_options) {
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ class IGC extends TextFeature {
|
|||||||
const options = opt_options ? opt_options : {};
|
const options = opt_options ? opt_options : {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @type {import("../proj/Projection.js").default}
|
||||||
*/
|
*/
|
||||||
this.dataProjection = getProjection('EPSG:4326');
|
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) {
|
readFeatureFromText(text, opt_options) {
|
||||||
const altitudeMode = this.altitudeMode_;
|
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<Feature>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromText(text, opt_options) {
|
readFeaturesFromText(text, opt_options) {
|
||||||
const feature = this.readFeatureFromText(text, opt_options);
|
const feature = this.readFeatureFromText(text, opt_options);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class JSONFeature extends FeatureFormat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @return {import("./FormatType.js").default} Format.
|
||||||
*/
|
*/
|
||||||
getType() {
|
getType() {
|
||||||
return FormatType.JSON;
|
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. Only works for a single feature. Use `readFeatures` to
|
||||||
* read a feature collection.
|
* 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.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {import("../Feature.js").default} Feature.
|
* @return {import("../Feature.js").default} Feature.
|
||||||
* @api
|
* @api
|
||||||
@@ -43,7 +43,7 @@ class JSONFeature extends FeatureFormat {
|
|||||||
* Read all features. Works with both a single feature and a feature
|
* Read all features. Works with both a single feature and a feature
|
||||||
* collection.
|
* 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.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {Array<import("../Feature.js").default>} Features.
|
* @return {Array<import("../Feature.js").default>} Features.
|
||||||
* @api
|
* @api
|
||||||
@@ -78,7 +78,7 @@ class JSONFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* Read a geometry.
|
* 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.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {import("../geom/Geometry.js").default} Geometry.
|
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||||
* @api
|
* @api
|
||||||
@@ -102,7 +102,7 @@ class JSONFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* Read the projection.
|
* 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.
|
* @return {import("../proj/Projection.js").default} Projection.
|
||||||
* @api
|
* @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.
|
* @return {Object} Object.
|
||||||
*/
|
*/
|
||||||
function getObject(source) {
|
function getObject(source) {
|
||||||
|
|||||||
@@ -427,7 +427,7 @@ class KML extends XMLFeature {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @type {import("../proj/Projection.js").default}
|
||||||
*/
|
*/
|
||||||
this.dataProjection = getProjection('EPSG:4326');
|
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) {
|
readFeatureFromNode(node, opt_options) {
|
||||||
if (!includes(NAMESPACE_URIS, node.namespaceURI)) {
|
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<import("../Feature.js").default>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromNode(node, opt_options) {
|
readFeaturesFromNode(node, opt_options) {
|
||||||
if (!includes(NAMESPACE_URIS, node.namespaceURI)) {
|
if (!includes(NAMESPACE_URIS, node.namespaceURI)) {
|
||||||
@@ -847,7 +852,6 @@ class KML extends XMLFeature {
|
|||||||
* @param {Array<Feature>} features Features.
|
* @param {Array<Feature>} features Features.
|
||||||
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
* @override
|
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
writeFeaturesNode(features, opt_options) {
|
writeFeaturesNode(features, opt_options) {
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ class MVT extends FeatureFormat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @return {import("./FormatType.js").default} Format.
|
||||||
*/
|
*/
|
||||||
getType() {
|
getType() {
|
||||||
return FormatType.ARRAY_BUFFER;
|
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
|
* @api
|
||||||
*/
|
*/
|
||||||
readProjection(source) {
|
readProjection(source) {
|
||||||
|
|||||||
@@ -58,13 +58,16 @@ class OSMXML extends XMLFeature {
|
|||||||
super();
|
super();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @type {import("../proj/Projection.js").default}
|
||||||
*/
|
*/
|
||||||
this.dataProjection = getProjection('EPSG:4326');
|
this.dataProjection = getProjection('EPSG:4326');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @protected
|
||||||
|
* @param {Element} node Node.
|
||||||
|
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||||
|
* @return {Array<import("../Feature.js").default>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromNode(node, opt_options) {
|
readFeaturesFromNode(node, opt_options) {
|
||||||
const options = this.getReadOptions(node, opt_options);
|
const options = this.getReadOptions(node, opt_options);
|
||||||
|
|||||||
@@ -33,19 +33,21 @@ class OWS extends XML {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @param {Document} doc Document.
|
||||||
|
* @return {Object} Object
|
||||||
*/
|
*/
|
||||||
readFromDocument(doc) {
|
readFromDocument(doc) {
|
||||||
for (let n = doc.firstChild; n; n = n.nextSibling) {
|
for (let n = doc.firstChild; n; n = n.nextSibling) {
|
||||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||||
return this.readFromNode(n);
|
return this.readFromNode(/** @type {Element} */ (n));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @param {Element} node Node.
|
||||||
|
* @return {Object} Object
|
||||||
*/
|
*/
|
||||||
readFromNode(node) {
|
readFromNode(node) {
|
||||||
const owsObject = pushParseAndPop({},
|
const owsObject = pushParseAndPop({},
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class Polyline extends TextFeature {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @type {import("../proj/Projection.js").default}
|
||||||
*/
|
*/
|
||||||
this.dataProjection = getProjection('EPSG:4326');
|
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) {
|
readFeatureFromText(text, opt_options) {
|
||||||
const geometry = this.readGeometryFromText(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<Feature>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromText(text, opt_options) {
|
readFeaturesFromText(text, opt_options) {
|
||||||
const feature = this.readFeatureFromText(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) {
|
readGeometryFromText(text, opt_options) {
|
||||||
const stride = getStrideForLayout(this.geometryLayout_);
|
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) {
|
writeFeatureText(feature, opt_options) {
|
||||||
const geometry = feature.getGeometry();
|
const geometry = feature.getGeometry();
|
||||||
@@ -108,14 +120,20 @@ class Polyline extends TextFeature {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @param {Array<import("../Feature.js").default>} features Features.
|
||||||
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
|
* @protected
|
||||||
|
* @return {string} Text.
|
||||||
*/
|
*/
|
||||||
writeFeaturesText(features, opt_options) {
|
writeFeaturesText(features, opt_options) {
|
||||||
return this.writeFeatureText(features[0], 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) {
|
writeGeometryText(geometry, opt_options) {
|
||||||
geometry = /** @type {LineString} */
|
geometry = /** @type {LineString} */
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class TextFeature extends FeatureFormat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @return {import("./FormatType.js").default} Format.
|
||||||
*/
|
*/
|
||||||
getType() {
|
getType() {
|
||||||
return FormatType.TEXT;
|
return FormatType.TEXT;
|
||||||
@@ -28,7 +28,7 @@ class TextFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* Read the feature from the source.
|
* 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.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {import("../Feature.js").default} Feature.
|
* @return {import("../Feature.js").default} Feature.
|
||||||
* @api
|
* @api
|
||||||
@@ -51,7 +51,7 @@ class TextFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* Read the features from the source.
|
* 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.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {Array<import("../Feature.js").default>} Features.
|
* @return {Array<import("../Feature.js").default>} Features.
|
||||||
* @api
|
* @api
|
||||||
@@ -74,7 +74,7 @@ class TextFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* Read the geometry from the source.
|
* 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.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {import("../geom/Geometry.js").default} Geometry.
|
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||||
* @api
|
* @api
|
||||||
@@ -97,7 +97,7 @@ class TextFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* Read the projection from the source.
|
* 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.
|
* @return {import("../proj/Projection.js").default} Projection.
|
||||||
* @api
|
* @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.
|
* @return {string} Text.
|
||||||
*/
|
*/
|
||||||
function getText(source) {
|
function getText(source) {
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class TopoJSON extends JSONFeature {
|
|||||||
this.layers_ = options.layers ? options.layers : null;
|
this.layers_ = options.layers ? options.layers : null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @type {import("../proj/Projection.js").default}
|
||||||
*/
|
*/
|
||||||
this.dataProjection = getProjection(
|
this.dataProjection = getProjection(
|
||||||
options.dataProjection ?
|
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<Feature>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromObject(object, opt_options) {
|
readFeaturesFromObject(object, opt_options) {
|
||||||
if (object.type == 'Topology') {
|
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) {
|
readProjectionFromObject(object) {
|
||||||
return this.dataProjection;
|
return this.dataProjection;
|
||||||
|
|||||||
@@ -254,7 +254,10 @@ class WFS extends XMLFeature {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @protected
|
||||||
|
* @param {Element} node Node.
|
||||||
|
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||||
|
* @return {Array<import("../Feature.js").default>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromNode(node, opt_options) {
|
readFeaturesFromNode(node, opt_options) {
|
||||||
/** @type {import("../xml.js").NodeStackItem} */
|
/** @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) {
|
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) {
|
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||||
return this.readProjectionFromNode(n);
|
return this.readProjectionFromNode(/** @type {Element} */ (n));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @param {Element} node Node.
|
||||||
|
* @return {import("../proj/Projection.js").default} Projection.
|
||||||
*/
|
*/
|
||||||
readProjectionFromNode(node) {
|
readProjectionFromNode(node) {
|
||||||
if (node.firstElementChild &&
|
if (node.firstElementChild &&
|
||||||
|
|||||||
@@ -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) {
|
readFeatureFromText(text, opt_options) {
|
||||||
const geom = this.readGeometryFromText(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<Feature>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromText(text, opt_options) {
|
readFeaturesFromText(text, opt_options) {
|
||||||
let geometries = [];
|
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) {
|
readGeometryFromText(text, opt_options) {
|
||||||
const geometry = this.parse_(text);
|
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) {
|
writeFeatureText(feature, opt_options) {
|
||||||
const geometry = feature.getGeometry();
|
const geometry = feature.getGeometry();
|
||||||
@@ -700,7 +712,10 @@ class WKT extends TextFeature {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @param {Array<import("../Feature.js").default>} features Features.
|
||||||
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
|
* @protected
|
||||||
|
* @return {string} Text.
|
||||||
*/
|
*/
|
||||||
writeFeaturesText(features, opt_options) {
|
writeFeaturesText(features, opt_options) {
|
||||||
if (features.length == 1) {
|
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) {
|
writeGeometryText(geometry, opt_options) {
|
||||||
return encode(transformGeometryWithOptions(geometry, true, opt_options));
|
return encode(transformGeometryWithOptions(geometry, true, opt_options));
|
||||||
|
|||||||
@@ -60,19 +60,21 @@ class WMSCapabilities extends XML {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @param {Document} doc Document.
|
||||||
|
* @return {Object} Object
|
||||||
*/
|
*/
|
||||||
readFromDocument(doc) {
|
readFromDocument(doc) {
|
||||||
for (let n = doc.firstChild; n; n = n.nextSibling) {
|
for (let n = doc.firstChild; n; n = n.nextSibling) {
|
||||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||||
return this.readFromNode(n);
|
return this.readFromNode(/** @type {Element} */ (n));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @param {Element} node Node.
|
||||||
|
* @return {Object} Object
|
||||||
*/
|
*/
|
||||||
readFromNode(node) {
|
readFromNode(node) {
|
||||||
this.version = node.getAttribute('version').trim();
|
this.version = node.getAttribute('version').trim();
|
||||||
|
|||||||
@@ -144,7 +144,10 @@ class WMSGetFeatureInfo extends XMLFeature {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @protected
|
||||||
|
* @param {Element} node Node.
|
||||||
|
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||||
|
* @return {Array<import("../Feature.js").default>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromNode(node, opt_options) {
|
readFeaturesFromNode(node, opt_options) {
|
||||||
const options = {};
|
const options = {};
|
||||||
|
|||||||
@@ -59,19 +59,21 @@ class WMTSCapabilities extends XML {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @param {Document} doc Document.
|
||||||
|
* @return {Object} Object
|
||||||
*/
|
*/
|
||||||
readFromDocument(doc) {
|
readFromDocument(doc) {
|
||||||
for (let n = doc.firstChild; n; n = n.nextSibling) {
|
for (let n = doc.firstChild; n; n = n.nextSibling) {
|
||||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||||
return this.readFromNode(n);
|
return this.readFromNode(/** @type {Element} */ (n));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @param {Element} node Node.
|
||||||
|
* @return {Object} Object
|
||||||
*/
|
*/
|
||||||
readFromNode(node) {
|
readFromNode(node) {
|
||||||
let version = node.getAttribute('version');
|
let version = node.getAttribute('version');
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @return {import("./FormatType.js").default} Format.
|
||||||
*/
|
*/
|
||||||
getType() {
|
getType() {
|
||||||
return FormatType.XML;
|
return FormatType.XML;
|
||||||
@@ -36,7 +36,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* Read a single feature.
|
* 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.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {import("../Feature.js").default} Feature.
|
* @return {import("../Feature.js").default} Feature.
|
||||||
* @api
|
* @api
|
||||||
@@ -50,7 +50,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
} else if (isDocument(source)) {
|
} else if (isDocument(source)) {
|
||||||
return this.readFeatureFromDocument(/** @type {Document} */ (source), opt_options);
|
return this.readFeatureFromDocument(/** @type {Document} */ (source), opt_options);
|
||||||
} else {
|
} 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.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||||
* @return {import("../Feature.js").default} Feature.
|
* @return {import("../Feature.js").default} Feature.
|
||||||
*/
|
*/
|
||||||
@@ -80,7 +80,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* Read all features from a feature collection.
|
* 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.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||||
* @return {Array<import("../Feature.js").default>} Features.
|
* @return {Array<import("../Feature.js").default>} Features.
|
||||||
* @api
|
* @api
|
||||||
@@ -95,7 +95,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
return this.readFeaturesFromDocument(
|
return this.readFeaturesFromDocument(
|
||||||
/** @type {Document} */ (source), opt_options);
|
/** @type {Document} */ (source), opt_options);
|
||||||
} else {
|
} 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) {
|
readFeaturesFromDocument(doc, opt_options) {
|
||||||
/** @type {Array<import("../Feature.js").default>} */
|
/** @type {Array<import("../Feature.js").default>} */
|
||||||
const features = [];
|
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) {
|
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||||
extend(features, this.readFeaturesFromNode(n, opt_options));
|
extend(features, this.readFeaturesFromNode(/** @type {Element} */ (n), opt_options));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return features;
|
return features;
|
||||||
@@ -118,7 +118,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {Array<import("../Feature.js").default>} Features.
|
* @return {Array<import("../Feature.js").default>} 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) {
|
readGeometry(source, opt_options) {
|
||||||
if (!source) {
|
if (!source) {
|
||||||
@@ -140,7 +144,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
return this.readGeometryFromDocument(
|
return this.readGeometryFromDocument(
|
||||||
/** @type {Document} */ (source), opt_options);
|
/** @type {Document} */ (source), opt_options);
|
||||||
} else {
|
} 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.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {import("../geom/Geometry.js").default} Geometry.
|
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||||
@@ -167,7 +171,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* Read the projection from the source.
|
* 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.
|
* @return {import("../proj/Projection.js").default} Projection.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -180,7 +184,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
} else if (isDocument(source)) {
|
} else if (isDocument(source)) {
|
||||||
return this.readProjectionFromDocument(/** @type {Document} */ (source));
|
return this.readProjectionFromDocument(/** @type {Document} */ (source));
|
||||||
} else {
|
} 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
|
* @protected
|
||||||
* @return {import("../proj/Projection.js").default} Projection.
|
* @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) {
|
writeFeature(feature, opt_options) {
|
||||||
const node = this.writeFeatureNode(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) {
|
writeGeometry(geometry, opt_options) {
|
||||||
const node = this.writeGeometryNode(geometry, opt_options);
|
const node = this.writeGeometryNode(geometry, opt_options);
|
||||||
|
|||||||
Reference in New Issue
Block a user