Merge pull request #13533 from ahocevar/gml-typescript

Update type annotations for GMLBase
This commit is contained in:
Andreas Hocevar
2022-04-01 19:05:07 +02:00
committed by GitHub

View File

@@ -255,33 +255,28 @@ class GMLBase extends XMLFeature {
/**
* @param {Element} node Node.
* @param {Array<*>} objectStack Object stack.
* @return {import("../geom/Geometry.js").default|import("../extent.js").Extent|undefined} Geometry.
* @return {import("../extent.js").Extent|undefined} Geometry.
*/
readExtentElement(node, objectStack) {
const context = /** @type {Object} */ (objectStack[0]);
const extent = this.readGeometryOrExtent(node, objectStack);
return extent
? transformExtentWithOptions(
/** @type {import("../extent.js").Extent} */ (extent),
context
)
: undefined;
const extent = /** @type {import("../extent.js").Extent} */ (
this.readGeometryOrExtent(node, objectStack)
);
return extent ? transformExtentWithOptions(extent, context) : undefined;
}
/**
* @param {Element} node Node.
* @param {Array<*>} objectStack Object stack.
* @return {import("../geom/Geometry.js").default|import("../extent.js").Extent|undefined} Geometry.
* @return {import("../geom/Geometry.js").default|undefined} Geometry.
*/
readGeometryElement(node, objectStack) {
const context = /** @type {Object} */ (objectStack[0]);
const geometry = this.readGeometryOrExtent(node, objectStack);
const geometry = /** @type {import("../geom/Geometry.js").default} */ (
this.readGeometryOrExtent(node, objectStack)
);
return geometry
? transformGeometryWithOptions(
/** @type {import("../geom/Geometry.js").default} */ (geometry),
false,
context
)
? transformGeometryWithOptions(geometry, false, context)
: undefined;
}
@@ -556,9 +551,8 @@ class GMLBase extends XMLFeature {
* @param {Element} node Node.
* @param {import("./Feature.js").ReadOptions} [opt_options] Options.
* @protected
* @return {import("../geom/Geometry.js").default|import("../extent.js").Extent} Geometry.
* @return {import("../geom/Geometry.js").default} Geometry.
*/
//@ts-ignore
readGeometryFromNode(node, opt_options) {
const geometry = this.readGeometryElement(node, [
this.getReadOptions(node, opt_options ? opt_options : {}),