Use Array<Foo> instead of Array.<Foo>
This commit is contained in:
@@ -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<module:ol/Feature>} */
|
||||
const features = [];
|
||||
const esriJSONFeatures = esriJSONFeatureCollection.features;
|
||||
options.idField = object.objectIdFieldName;
|
||||
@@ -188,7 +188,7 @@ class EsriJSON extends JSONFeature {
|
||||
/**
|
||||
* Encode an array of features as a EsriJSON object.
|
||||
*
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {Object} EsriJSON Object.
|
||||
* @override
|
||||
@@ -252,9 +252,9 @@ function readGeometry(object, opt_options) {
|
||||
* Checks if any polygons in this array contain any other polygons in this
|
||||
* 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 {Array<!Array<!Array<number>>>} rings Rings.
|
||||
* @param {module:ol/geom/GeometryLayout} layout Geometry layout.
|
||||
* @return {Array.<!Array.<!Array.<number>>>} Transformed rings.
|
||||
* @return {Array<!Array<!Array<number>>>} Transformed rings.
|
||||
*/
|
||||
function convertRings(rings, layout) {
|
||||
const flatRing = [];
|
||||
@@ -376,7 +376,7 @@ function readMultiPointGeometry(object) {
|
||||
function readMultiPolygonGeometry(object) {
|
||||
const layout = getGeometryLayout(object);
|
||||
return new MultiPolygon(
|
||||
/** @type {Array.<Array.<Array.<Array.<number>>>>} */(object.rings),
|
||||
/** @type {Array<Array<Array<Array<number>>>>} */(object.rings),
|
||||
layout);
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ 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.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
*/
|
||||
readFeatures(source, opt_options) {}
|
||||
|
||||
@@ -178,7 +178,7 @@ class FeatureFormat {
|
||||
* Encode an array of features in this format.
|
||||
*
|
||||
* @abstract
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {string} Result.
|
||||
*/
|
||||
@@ -234,8 +234,8 @@ export function transformWithOptions(geometry, write, opt_options) {
|
||||
const power = Math.pow(10, opt_options.decimals);
|
||||
// if decimals option on write, round each coordinate appropriately
|
||||
/**
|
||||
* @param {Array.<number>} coordinates Coordinates.
|
||||
* @return {Array.<number>} Transformed coordinates.
|
||||
* @param {Array<number>} coordinates Coordinates.
|
||||
* @return {Array<number>} Transformed coordinates.
|
||||
*/
|
||||
const transform = function(coordinates) {
|
||||
for (let i = 0, ii = coordinates.length; i < ii; ++i) {
|
||||
|
||||
@@ -20,7 +20,7 @@ const GML = GML3;
|
||||
* Encode an array of features in GML 3.1.1 Simple Features.
|
||||
*
|
||||
* @function
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @return {string} Result.
|
||||
* @api
|
||||
@@ -32,7 +32,7 @@ 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 {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @return {Node} Node.
|
||||
* @api
|
||||
|
||||
@@ -63,9 +63,9 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<number>|undefined} Flat coordinates.
|
||||
* @return {Array<number>|undefined} Flat coordinates.
|
||||
*/
|
||||
readFlatCoordinates_(node, objectStack) {
|
||||
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
||||
@@ -96,12 +96,12 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/extent~Extent|undefined} Envelope.
|
||||
*/
|
||||
readBox_(node, objectStack) {
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const flatCoordinates = pushParseAndPop([null],
|
||||
this.BOX_PARSERS_, node, objectStack, this);
|
||||
return createOrUpdate(flatCoordinates[1][0],
|
||||
@@ -111,15 +111,15 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
innerBoundaryIsParser_(node, objectStack) {
|
||||
/** @type {Array.<number>|undefined} */
|
||||
/** @type {Array<number>|undefined} */
|
||||
const flatLinearRing = pushParseAndPop(undefined,
|
||||
this.RING_PARSERS, node, objectStack, this);
|
||||
if (flatLinearRing) {
|
||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
flatLinearRings.push(flatLinearRing);
|
||||
}
|
||||
@@ -127,15 +127,15 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
outerBoundaryIsParser_(node, objectStack) {
|
||||
/** @type {Array.<number>|undefined} */
|
||||
/** @type {Array<number>|undefined} */
|
||||
const flatLinearRing = pushParseAndPop(undefined,
|
||||
this.RING_PARSERS, node, objectStack, this);
|
||||
if (flatLinearRing) {
|
||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
flatLinearRings[0] = flatLinearRing;
|
||||
}
|
||||
@@ -144,7 +144,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @const
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node|undefined} Node.
|
||||
* @private
|
||||
@@ -174,7 +174,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
writeFeatureElement(node, feature, objectStack) {
|
||||
const fid = feature.getId();
|
||||
@@ -220,7 +220,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString} geometry LineString geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeCurveOrLineString_(node, geometry, objectStack) {
|
||||
@@ -245,7 +245,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeLineStringOrCurveMember_(node, line, objectStack) {
|
||||
@@ -259,7 +259,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/MultiLineString} geometry MultiLineString geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeMultiCurveOrLineString_(node, geometry, objectStack) {
|
||||
@@ -280,7 +280,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Geometry|module:ol/extent~Extent} geometry Geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
writeGeometryElement(node, geometry, objectStack) {
|
||||
const context = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[objectStack.length - 1]);
|
||||
@@ -320,7 +320,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString|module:ol/geom/LinearRing} value Geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeCoordinates_(node, value, objectStack) {
|
||||
@@ -341,7 +341,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeCurveSegments_(node, line, objectStack) {
|
||||
@@ -353,7 +353,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Polygon} geometry Polygon geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||
@@ -380,7 +380,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node} Node.
|
||||
* @private
|
||||
@@ -399,7 +399,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeSurfacePatches_(node, polygon, objectStack) {
|
||||
@@ -411,7 +411,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LinearRing} ring LinearRing geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeRing_(node, ring, objectStack) {
|
||||
@@ -421,7 +421,7 @@ class GML2 extends GMLBase {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} point Point geometry.
|
||||
* @param {Array<number>} point Point geometry.
|
||||
* @param {string=} opt_srsName Optional srsName
|
||||
* @param {boolean=} opt_hasZ whether the geometry has a Z coordinate (is 3D) or not.
|
||||
* @return {string} The coords string.
|
||||
@@ -447,7 +447,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Point} geometry Point geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writePoint_(node, geometry, objectStack) {
|
||||
@@ -467,7 +467,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/MultiPoint} geometry MultiPoint geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeMultiPoint_(node, geometry, objectStack) {
|
||||
@@ -487,7 +487,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Point} point Point geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writePointMember_(node, point, objectStack) {
|
||||
@@ -499,7 +499,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LinearRing} geometry LinearRing geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeLinearRing_(node, geometry, objectStack) {
|
||||
@@ -516,7 +516,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/MultiPolygon} geometry MultiPolygon geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeMultiSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||
@@ -537,7 +537,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeSurfaceOrPolygonMember_(node, polygon, objectStack) {
|
||||
@@ -552,7 +552,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeEnvelope(node, extent, objectStack) {
|
||||
@@ -573,7 +573,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @const
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node|undefined} Node.
|
||||
* @private
|
||||
|
||||
@@ -103,12 +103,12 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
||||
*/
|
||||
readMultiCurve_(node, objectStack) {
|
||||
/** @type {Array.<module:ol/geom/LineString>} */
|
||||
/** @type {Array<module:ol/geom/LineString>} */
|
||||
const lineStrings = pushParseAndPop([],
|
||||
this.MULTICURVE_PARSERS_, node, objectStack, this);
|
||||
if (lineStrings) {
|
||||
@@ -121,12 +121,12 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/geom/MultiPolygon|undefined} MultiPolygon.
|
||||
*/
|
||||
readMultiSurface_(node, objectStack) {
|
||||
/** @type {Array.<module:ol/geom/Polygon>} */
|
||||
/** @type {Array<module:ol/geom/Polygon>} */
|
||||
const polygons = pushParseAndPop([],
|
||||
this.MULTISURFACE_PARSERS_, node, objectStack, this);
|
||||
if (polygons) {
|
||||
@@ -136,7 +136,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
curveMemberParser_(node, objectStack) {
|
||||
@@ -145,7 +145,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
surfaceMemberParser_(node, objectStack) {
|
||||
@@ -155,9 +155,9 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
|
||||
* @return {Array<(Array<number>)>|undefined} flat coordinates.
|
||||
*/
|
||||
readPatch_(node, objectStack) {
|
||||
return pushParseAndPop([null],
|
||||
@@ -166,9 +166,9 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<number>|undefined} flat coordinates.
|
||||
* @return {Array<number>|undefined} flat coordinates.
|
||||
*/
|
||||
readSegment_(node, objectStack) {
|
||||
return pushParseAndPop([null],
|
||||
@@ -177,9 +177,9 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
|
||||
* @return {Array<(Array<number>)>|undefined} flat coordinates.
|
||||
*/
|
||||
readPolygonPatch_(node, objectStack) {
|
||||
return pushParseAndPop([null],
|
||||
@@ -188,9 +188,9 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<number>|undefined} flat coordinates.
|
||||
* @return {Array<number>|undefined} flat coordinates.
|
||||
*/
|
||||
readLineStringSegment_(node, objectStack) {
|
||||
return pushParseAndPop([null],
|
||||
@@ -200,15 +200,15 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
interiorParser_(node, objectStack) {
|
||||
/** @type {Array.<number>|undefined} */
|
||||
/** @type {Array<number>|undefined} */
|
||||
const flatLinearRing = pushParseAndPop(undefined,
|
||||
this.RING_PARSERS, node, objectStack, this);
|
||||
if (flatLinearRing) {
|
||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
flatLinearRings.push(flatLinearRing);
|
||||
}
|
||||
@@ -216,15 +216,15 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
exteriorParser_(node, objectStack) {
|
||||
/** @type {Array.<number>|undefined} */
|
||||
/** @type {Array<number>|undefined} */
|
||||
const flatLinearRing = pushParseAndPop(undefined,
|
||||
this.RING_PARSERS, node, objectStack, this);
|
||||
if (flatLinearRing) {
|
||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
flatLinearRings[0] = flatLinearRing;
|
||||
}
|
||||
@@ -232,12 +232,12 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
||||
*/
|
||||
readSurface_(node, objectStack) {
|
||||
/** @type {Array.<Array.<number>>} */
|
||||
/** @type {Array<Array<number>>} */
|
||||
const flatLinearRings = pushParseAndPop([null],
|
||||
this.SURFACE_PARSERS_, node, objectStack, this);
|
||||
if (flatLinearRings && flatLinearRings[0]) {
|
||||
@@ -256,12 +256,12 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/geom/LineString|undefined} LineString.
|
||||
*/
|
||||
readCurve_(node, objectStack) {
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const flatCoordinates = pushParseAndPop([null],
|
||||
this.CURVE_PARSERS_, node, objectStack, this);
|
||||
if (flatCoordinates) {
|
||||
@@ -274,12 +274,12 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/extent~Extent|undefined} Envelope.
|
||||
*/
|
||||
readEnvelope_(node, objectStack) {
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const flatCoordinates = pushParseAndPop([null],
|
||||
this.ENVELOPE_PARSERS_, node, objectStack, this);
|
||||
return createOrUpdate(flatCoordinates[1][0],
|
||||
@@ -289,14 +289,14 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<number>|undefined} Flat coordinates.
|
||||
* @return {Array<number>|undefined} Flat coordinates.
|
||||
*/
|
||||
readFlatPos_(node, objectStack) {
|
||||
let s = getAllTextContent(node, false);
|
||||
const re = /^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/;
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const flatCoordinates = [];
|
||||
let m;
|
||||
while ((m = re.exec(s))) {
|
||||
@@ -334,9 +334,9 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<number>|undefined} Flat coordinates.
|
||||
* @return {Array<number>|undefined} Flat coordinates.
|
||||
*/
|
||||
readFlatPosList_(node, objectStack) {
|
||||
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
||||
@@ -381,7 +381,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Point} value Point geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writePos_(node, value, objectStack) {
|
||||
@@ -411,7 +411,7 @@ class GML3 extends GMLBase {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} point Point geometry.
|
||||
* @param {Array<number>} point Point geometry.
|
||||
* @param {string=} opt_srsName Optional srsName
|
||||
* @param {boolean=} opt_hasZ whether the geometry has a Z coordinate (is 3D) or not.
|
||||
* @return {string} The coords string.
|
||||
@@ -437,7 +437,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString|module:ol/geom/LinearRing} value Geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writePosList_(node, value, objectStack) {
|
||||
@@ -461,7 +461,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Point} geometry Point geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writePoint_(node, geometry, objectStack) {
|
||||
@@ -478,7 +478,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
writeEnvelope(node, extent, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -498,7 +498,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LinearRing} geometry LinearRing geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeLinearRing_(node, geometry, objectStack) {
|
||||
@@ -514,7 +514,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node} Node.
|
||||
* @private
|
||||
@@ -533,7 +533,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Polygon} geometry Polygon geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||
@@ -561,7 +561,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString} geometry LineString geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeCurveOrLineString_(node, geometry, objectStack) {
|
||||
@@ -586,7 +586,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/MultiPolygon} geometry MultiPolygon geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeMultiSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||
@@ -607,7 +607,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/MultiPoint} geometry MultiPoint geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeMultiPoint_(node, geometry, objectStack) {
|
||||
@@ -627,7 +627,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/MultiLineString} geometry MultiLineString geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeMultiCurveOrLineString_(node, geometry, objectStack) {
|
||||
@@ -648,7 +648,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LinearRing} ring LinearRing geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeRing_(node, ring, objectStack) {
|
||||
@@ -660,7 +660,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeSurfaceOrPolygonMember_(node, polygon, objectStack) {
|
||||
@@ -675,7 +675,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Point} point Point geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writePointMember_(node, point, objectStack) {
|
||||
@@ -687,7 +687,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeLineStringOrCurveMember_(node, line, objectStack) {
|
||||
@@ -701,7 +701,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeSurfacePatches_(node, polygon, objectStack) {
|
||||
@@ -713,7 +713,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeCurveSegments_(node, line, objectStack) {
|
||||
@@ -726,7 +726,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Geometry|module:ol/extent~Extent} geometry Geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
writeGeometryElement(node, geometry, objectStack) {
|
||||
const context = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[objectStack.length - 1]);
|
||||
@@ -752,7 +752,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
writeFeatureElement(node, feature, objectStack) {
|
||||
const fid = feature.getId();
|
||||
@@ -797,8 +797,8 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeFeatureMembers_(node, features, objectStack) {
|
||||
@@ -821,7 +821,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @const
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node|undefined} Node.
|
||||
* @private
|
||||
@@ -835,7 +835,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @const
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node|undefined} Node.
|
||||
* @private
|
||||
@@ -890,7 +890,7 @@ 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 {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @return {Node} Node.
|
||||
* @override
|
||||
@@ -1100,7 +1100,7 @@ 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 {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @return {string} Result.
|
||||
* @api
|
||||
|
||||
@@ -52,7 +52,7 @@ const ONLY_WHITESPACE_RE = /^[\s\xa0]*$/;
|
||||
* feature namespaces themselves. So for instance there might be a featureType
|
||||
* item `topp:states` in the `featureType` array and then there will be a key
|
||||
* `topp` in the featureNS object with value `http://www.openplans.org/topp`.
|
||||
* @property {Array.<string>|string} [featureType] Feature type(s) to parse.
|
||||
* @property {Array<string>|string} [featureType] Feature type(s) to parse.
|
||||
* If multiple feature types need to be configured
|
||||
* which come from different feature namespaces, `featureNS` will be an object
|
||||
* with the keys being the prefixes used in the entries of featureType array.
|
||||
@@ -96,7 +96,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {Array.<string>|string|undefined}
|
||||
* @type {Array<string>|string|undefined}
|
||||
*/
|
||||
this.featureType = options.featureType;
|
||||
|
||||
@@ -131,8 +131,8 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<module:ol/Feature> | undefined} Features.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<module:ol/Feature> | undefined} Features.
|
||||
*/
|
||||
readFeaturesInternal(node, objectStack) {
|
||||
const localName = node.localName;
|
||||
@@ -219,7 +219,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/Geometry|undefined} Geometry.
|
||||
*/
|
||||
readGeometryElement(node, objectStack) {
|
||||
@@ -239,7 +239,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/Feature} Feature.
|
||||
*/
|
||||
readFeatureElement(node, objectStack) {
|
||||
@@ -280,7 +280,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/Point|undefined} Point.
|
||||
*/
|
||||
readPoint(node, objectStack) {
|
||||
@@ -292,11 +292,11 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/MultiPoint|undefined} MultiPoint.
|
||||
*/
|
||||
readMultiPoint(node, objectStack) {
|
||||
/** @type {Array.<Array.<number>>} */
|
||||
/** @type {Array<Array<number>>} */
|
||||
const coordinates = pushParseAndPop([],
|
||||
this.MULTIPOINT_PARSERS_, node, objectStack, this);
|
||||
if (coordinates) {
|
||||
@@ -308,11 +308,11 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
||||
*/
|
||||
readMultiLineString(node, objectStack) {
|
||||
/** @type {Array.<module:ol/geom/LineString>} */
|
||||
/** @type {Array<module:ol/geom/LineString>} */
|
||||
const lineStrings = pushParseAndPop([],
|
||||
this.MULTILINESTRING_PARSERS_, node, objectStack, this);
|
||||
if (lineStrings) {
|
||||
@@ -322,11 +322,11 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/MultiPolygon|undefined} MultiPolygon.
|
||||
*/
|
||||
readMultiPolygon(node, objectStack) {
|
||||
/** @type {Array.<module:ol/geom/Polygon>} */
|
||||
/** @type {Array<module:ol/geom/Polygon>} */
|
||||
const polygons = pushParseAndPop([], this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
|
||||
if (polygons) {
|
||||
return new MultiPolygon(polygons);
|
||||
@@ -335,7 +335,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
pointMemberParser_(node, objectStack) {
|
||||
@@ -344,7 +344,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
lineStringMemberParser_(node, objectStack) {
|
||||
@@ -353,7 +353,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
polygonMemberParser_(node, objectStack) {
|
||||
@@ -362,7 +362,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/LineString|undefined} LineString.
|
||||
*/
|
||||
readLineString(node, objectStack) {
|
||||
@@ -377,9 +377,9 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<number>|undefined} LinearRing flat coordinates.
|
||||
* @return {Array<number>|undefined} LinearRing flat coordinates.
|
||||
*/
|
||||
readFlatLinearRing_(node, objectStack) {
|
||||
const ring = pushParseAndPop(null,
|
||||
@@ -394,7 +394,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/LinearRing|undefined} LinearRing.
|
||||
*/
|
||||
readLinearRing(node, objectStack) {
|
||||
@@ -406,11 +406,11 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
||||
*/
|
||||
readPolygon(node, objectStack) {
|
||||
/** @type {Array.<Array.<number>>} */
|
||||
/** @type {Array<Array<number>>} */
|
||||
const flatLinearRings = pushParseAndPop([null],
|
||||
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
|
||||
if (flatLinearRings && flatLinearRings[0]) {
|
||||
@@ -429,9 +429,9 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
* @return {Array<number>} Flat coordinates.
|
||||
*/
|
||||
readFlatCoordinatesFromNode_(node, objectStack) {
|
||||
return pushParseAndPop(null, this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node, objectStack, this);
|
||||
|
||||
@@ -19,7 +19,7 @@ import {createElementNS, makeArrayPusher, makeArraySerializer, makeChildAppender
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<null|string>}
|
||||
* @type {Array<null|string>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [
|
||||
null,
|
||||
@@ -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<*>): (module:ol/Feature|undefined)>}
|
||||
*/
|
||||
const FEATURE_READER = {
|
||||
'rte': readRte,
|
||||
@@ -138,7 +138,7 @@ class GPX extends XMLFeature {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<module:ol/Feature>} features List of features.
|
||||
* @param {Array<module:ol/Feature>} 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<module:ol/Feature>} */
|
||||
const features = pushParseAndPop([], GPX_PARSERS,
|
||||
node, [this.getReadOptions(node, opt_options)]);
|
||||
if (features) {
|
||||
@@ -200,7 +200,7 @@ class GPX extends XMLFeature {
|
||||
* LineString geometries are output as routes (`<rte>`), and MultiLineString
|
||||
* as tracks (`<trk>`).
|
||||
*
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @return {Node} Node.
|
||||
* @override
|
||||
@@ -321,7 +321,7 @@ const WPT_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
const LINK_SEQUENCE = ['text', 'type'];
|
||||
|
||||
@@ -339,7 +339,7 @@ const LINK_SERIALIZERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const RTE_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -366,7 +366,7 @@ const RTE_SERIALIZERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const RTEPT_TYPE_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -376,7 +376,7 @@ const RTEPT_TYPE_SEQUENCE = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const TRK_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -403,7 +403,7 @@ const TRK_SERIALIZERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
||||
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||
*/
|
||||
const TRKSEG_NODE_FACTORY = makeSimpleNodeFactory('trkpt');
|
||||
|
||||
@@ -420,7 +420,7 @@ const TRKSEG_SERIALIZERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const WPT_TYPE_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -470,7 +470,7 @@ const GEOMETRY_TYPE_TO_NODENAME = {
|
||||
|
||||
/**
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node|undefined} Node.
|
||||
*/
|
||||
@@ -487,11 +487,11 @@ function GPX_NODE_FACTORY(value, objectStack, opt_nodeName) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {module:ol/format/GPX~LayoutOptions} layoutOptions Layout options.
|
||||
* @param {Node} node Node.
|
||||
* @param {!Object} values Values.
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
* @return {Array<number>} Flat coordinates.
|
||||
*/
|
||||
function appendCoordinate(flatCoordinates, layoutOptions, node, values) {
|
||||
flatCoordinates.push(
|
||||
@@ -520,8 +520,8 @@ function appendCoordinate(flatCoordinates, layoutOptions, node, values) {
|
||||
* and ends arrays by shrinking them accordingly (removing unused zero entries).
|
||||
*
|
||||
* @param {module:ol/format/GPX~LayoutOptions} layoutOptions Layout options.
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array.<number>=} ends Ends.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>=} ends Ends.
|
||||
* @return {module:ol/geom/GeometryLayout} Layout.
|
||||
*/
|
||||
function applyLayoutOptions(layoutOptions, flatCoordinates, ends) {
|
||||
@@ -561,7 +561,7 @@ function applyLayoutOptions(layoutOptions, flatCoordinates, ends) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function parseLink(node, objectStack) {
|
||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
@@ -575,7 +575,7 @@ function parseLink(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function parseExtensions(node, objectStack) {
|
||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
@@ -585,13 +585,13 @@ function parseExtensions(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function parseRtePt(node, objectStack) {
|
||||
const values = pushParseAndPop({}, RTEPT_PARSERS, node, objectStack);
|
||||
if (values) {
|
||||
const rteValues = /** @type {!Object} */ (objectStack[objectStack.length - 1]);
|
||||
const flatCoordinates = /** @type {Array.<number>} */ (rteValues['flatCoordinates']);
|
||||
const flatCoordinates = /** @type {Array<number>} */ (rteValues['flatCoordinates']);
|
||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (rteValues['layoutOptions']);
|
||||
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
||||
}
|
||||
@@ -600,13 +600,13 @@ function parseRtePt(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function parseTrkPt(node, objectStack) {
|
||||
const values = pushParseAndPop({}, TRKPT_PARSERS, node, objectStack);
|
||||
if (values) {
|
||||
const trkValues = /** @type {!Object} */ (objectStack[objectStack.length - 1]);
|
||||
const flatCoordinates = /** @type {Array.<number>} */ (trkValues['flatCoordinates']);
|
||||
const flatCoordinates = /** @type {Array<number>} */ (trkValues['flatCoordinates']);
|
||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (trkValues['layoutOptions']);
|
||||
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
||||
}
|
||||
@@ -615,21 +615,21 @@ function parseTrkPt(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function parseTrkSeg(node, objectStack) {
|
||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
parseNode(TRKSEG_PARSERS, node, objectStack);
|
||||
const flatCoordinates = /** @type {Array.<number>} */
|
||||
const flatCoordinates = /** @type {Array<number>} */
|
||||
(values['flatCoordinates']);
|
||||
const ends = /** @type {Array.<number>} */ (values['ends']);
|
||||
const ends = /** @type {Array<number>} */ (values['ends']);
|
||||
ends.push(flatCoordinates.length);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/Feature|undefined} Track.
|
||||
*/
|
||||
function readRte(node, objectStack) {
|
||||
@@ -641,7 +641,7 @@ function readRte(node, objectStack) {
|
||||
if (!values) {
|
||||
return undefined;
|
||||
}
|
||||
const flatCoordinates = /** @type {Array.<number>} */
|
||||
const flatCoordinates = /** @type {Array<number>} */
|
||||
(values['flatCoordinates']);
|
||||
delete values['flatCoordinates'];
|
||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (values['layoutOptions']);
|
||||
@@ -657,7 +657,7 @@ function readRte(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/Feature|undefined} Track.
|
||||
*/
|
||||
function readTrk(node, objectStack) {
|
||||
@@ -670,10 +670,10 @@ function readTrk(node, objectStack) {
|
||||
if (!values) {
|
||||
return undefined;
|
||||
}
|
||||
const flatCoordinates = /** @type {Array.<number>} */
|
||||
const flatCoordinates = /** @type {Array<number>} */
|
||||
(values['flatCoordinates']);
|
||||
delete values['flatCoordinates'];
|
||||
const ends = /** @type {Array.<number>} */ (values['ends']);
|
||||
const ends = /** @type {Array<number>} */ (values['ends']);
|
||||
delete values['ends'];
|
||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (values['layoutOptions']);
|
||||
delete values['layoutOptions'];
|
||||
@@ -688,7 +688,7 @@ function readTrk(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/Feature|undefined} Waypoint.
|
||||
*/
|
||||
function readWpt(node, objectStack) {
|
||||
@@ -711,7 +711,7 @@ function readWpt(node, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {string} value Value for the link's `href` attribute.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeLink(node, value, objectStack) {
|
||||
node.setAttribute('href', value);
|
||||
@@ -730,7 +730,7 @@ function writeLink(node, value, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeWptType(node, coordinate, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -774,7 +774,7 @@ function writeWptType(node, coordinate, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeRte(node, feature, objectStack) {
|
||||
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
||||
@@ -798,7 +798,7 @@ function writeRte(node, feature, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeTrk(node, feature, objectStack) {
|
||||
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
||||
@@ -823,7 +823,7 @@ function writeTrk(node, feature, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString} lineString LineString.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeTrkSeg(node, lineString, objectStack) {
|
||||
/** @type {module:ol/xml~NodeStackItem} */
|
||||
@@ -838,7 +838,7 @@ function writeTrkSeg(node, lineString, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeWpt(node, feature, objectStack) {
|
||||
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
||||
|
||||
@@ -115,7 +115,7 @@ class GeoJSON extends JSONFeature {
|
||||
*/
|
||||
readFeaturesFromObject(object, opt_options) {
|
||||
const geoJSONObject = /** @type {GeoJSONObject} */ (object);
|
||||
/** @type {Array.<module:ol/Feature>} */
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
let features = null;
|
||||
if (geoJSONObject.type === 'FeatureCollection') {
|
||||
const geoJSONFeatureCollection = /** @type {GeoJSONFeatureCollection} */ (object);
|
||||
@@ -196,7 +196,7 @@ class GeoJSON extends JSONFeature {
|
||||
/**
|
||||
* Encode an array of features as a GeoJSON object.
|
||||
*
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {GeoJSONFeatureCollection} GeoJSON Object.
|
||||
* @override
|
||||
|
||||
@@ -44,7 +44,7 @@ class JSONFeature extends FeatureFormat {
|
||||
*
|
||||
* @param {ArrayBuffer|Document|Node|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
readFeatures(source, opt_options) {
|
||||
@@ -66,7 +66,7 @@ class JSONFeature extends FeatureFormat {
|
||||
* @param {Object} object Object.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @protected
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
*/
|
||||
readFeaturesFromObject(object, opt_options) {}
|
||||
|
||||
@@ -134,7 +134,7 @@ class JSONFeature extends FeatureFormat {
|
||||
/**
|
||||
* Encode an array of features as string.
|
||||
*
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {string} Encoded features.
|
||||
* @api
|
||||
@@ -145,7 +145,7 @@ class JSONFeature extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {Object} Object.
|
||||
*/
|
||||
|
||||
@@ -43,14 +43,14 @@ import {createElementNS, getAllTextContent, isDocument, isNode, makeArrayExtende
|
||||
|
||||
/**
|
||||
* @typedef {Object} GxTrackObject
|
||||
* @property {Array.<number>} flatCoordinates
|
||||
* @property {Array.<number>} whens
|
||||
* @property {Array<number>} flatCoordinates
|
||||
* @property {Array<number>} whens
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
const GX_NAMESPACE_URIS = [
|
||||
'http://www.google.com/kml/ext/2.2'
|
||||
@@ -59,7 +59,7 @@ const GX_NAMESPACE_URIS = [
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<null|string>}
|
||||
* @type {Array<null|string>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [
|
||||
null,
|
||||
@@ -165,7 +165,7 @@ const REGION_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const KML_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -295,13 +295,13 @@ export function getDefaultStyle() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/style/Style>}
|
||||
* @type {Array<module:ol/style/Style>}
|
||||
*/
|
||||
let DEFAULT_STYLE_ARRAY = null;
|
||||
|
||||
/**
|
||||
* Get the default style array (or null if not yet set).
|
||||
* @return {Array.<module:ol/style/Style>} The default style.
|
||||
* @return {Array<module:ol/style/Style>} The default style.
|
||||
*/
|
||||
export function getDefaultStyleArray() {
|
||||
return DEFAULT_STYLE_ARRAY;
|
||||
@@ -377,7 +377,7 @@ function createStyleDefaults() {
|
||||
* @typedef {Object} Options
|
||||
* @property {boolean} [extractStyles=true] Extract styles from the KML.
|
||||
* @property {boolean} [showPointNames=true] Show names as labels for placemarks which contain points.
|
||||
* @property {Array.<module:ol/style/Style>} [defaultStyle] Default style. The
|
||||
* @property {Array<module:ol/style/Style>} [defaultStyle] Default style. The
|
||||
* default default style is the same as Google Earth.
|
||||
* @property {boolean} [writeStyles=true] Write styles into KML.
|
||||
*/
|
||||
@@ -420,7 +420,7 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<module:ol/style/Style>}
|
||||
* @type {Array<module:ol/style/Style>}
|
||||
*/
|
||||
this.defaultStyle_ = options.defaultStyle ?
|
||||
options.defaultStyle : DEFAULT_STYLE_ARRAY;
|
||||
@@ -441,7 +441,7 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object.<string, (Array.<module:ol/style/Style>|string)>}
|
||||
* @type {!Object.<string, (Array<module:ol/style/Style>|string)>}
|
||||
*/
|
||||
this.sharedStyles_ = {};
|
||||
|
||||
@@ -456,9 +456,9 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<module:ol/Feature>|undefined} Features.
|
||||
* @return {Array<module:ol/Feature>|undefined} Features.
|
||||
*/
|
||||
readDocumentOrFolder_(node, objectStack) {
|
||||
// FIXME use scope somehow
|
||||
@@ -470,7 +470,7 @@ class KML extends XMLFeature {
|
||||
'Style': this.readSharedStyle_.bind(this),
|
||||
'StyleMap': this.readSharedStyleMap_.bind(this)
|
||||
});
|
||||
/** @type {Array.<module:ol/Feature>} */
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
const features = pushParseAndPop([], parsersNS, node, objectStack, this);
|
||||
if (features) {
|
||||
return features;
|
||||
@@ -481,7 +481,7 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/Feature|undefined} Feature.
|
||||
*/
|
||||
@@ -524,7 +524,7 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
readSharedStyle_(node, objectStack) {
|
||||
@@ -550,7 +550,7 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
readSharedStyleMap_(node, objectStack) {
|
||||
@@ -698,7 +698,7 @@ class KML extends XMLFeature {
|
||||
* Read the network links of the KML.
|
||||
*
|
||||
* @param {Document|Node|string} source Source.
|
||||
* @return {Array.<Object>} Network links.
|
||||
* @return {Array<Object>} Network links.
|
||||
* @api
|
||||
*/
|
||||
readNetworkLinks(source) {
|
||||
@@ -718,7 +718,7 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Document} doc Document.
|
||||
* @return {Array.<Object>} Network links.
|
||||
* @return {Array<Object>} Network links.
|
||||
*/
|
||||
readNetworkLinksFromDocument(doc) {
|
||||
const networkLinks = [];
|
||||
@@ -732,7 +732,7 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @return {Array.<Object>} Network links.
|
||||
* @return {Array<Object>} Network links.
|
||||
*/
|
||||
readNetworkLinksFromNode(node) {
|
||||
const networkLinks = [];
|
||||
@@ -760,7 +760,7 @@ class KML extends XMLFeature {
|
||||
* Read the regions of the KML.
|
||||
*
|
||||
* @param {Document|Node|string} source Source.
|
||||
* @return {Array.<Object>} Regions.
|
||||
* @return {Array<Object>} Regions.
|
||||
* @api
|
||||
*/
|
||||
readRegion(source) {
|
||||
@@ -780,7 +780,7 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Document} doc Document.
|
||||
* @return {Array.<Object>} Region.
|
||||
* @return {Array<Object>} Region.
|
||||
*/
|
||||
readRegionFromDocument(doc) {
|
||||
const regions = [];
|
||||
@@ -794,7 +794,7 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @return {Array.<Object>} Region.
|
||||
* @return {Array<Object>} Region.
|
||||
* @api
|
||||
*/
|
||||
readRegionFromNode(node) {
|
||||
@@ -823,7 +823,7 @@ class KML extends XMLFeature {
|
||||
* Encode an array of features in the KML format as an XML node. GeometryCollections,
|
||||
* MultiPoints, MultiLineStrings, and MultiPolygons are output as MultiGeometries.
|
||||
*
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @return {Node} Node.
|
||||
* @override
|
||||
@@ -902,10 +902,10 @@ function createNameStyleFunction(foundStyle, name) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<module:ol/style/Style>|undefined} style Style.
|
||||
* @param {Array<module:ol/style/Style>|undefined} style Style.
|
||||
* @param {string} styleUrl Style URL.
|
||||
* @param {Array.<module:ol/style/Style>} defaultStyle Default style.
|
||||
* @param {!Object.<string, (Array.<module:ol/style/Style>|string)>} sharedStyles Shared styles.
|
||||
* @param {Array<module:ol/style/Style>} defaultStyle Default style.
|
||||
* @param {!Object.<string, (Array<module:ol/style/Style>|string)>} sharedStyles Shared styles.
|
||||
* @param {boolean|undefined} showPointNames true to show names for point placemarks.
|
||||
* @return {module:ol/style/Style~StyleFunction} Feature style function.
|
||||
*/
|
||||
@@ -915,7 +915,7 @@ function createFeatureStyleFunction(style, styleUrl, defaultStyle, sharedStyles,
|
||||
/**
|
||||
* @param {module:ol/Feature} feature feature.
|
||||
* @param {number} resolution Resolution.
|
||||
* @return {Array.<module:ol/style/Style>} Style.
|
||||
* @return {Array<module:ol/style/Style>} Style.
|
||||
*/
|
||||
function(feature, resolution) {
|
||||
let drawName = showPointNames;
|
||||
@@ -960,11 +960,11 @@ function createFeatureStyleFunction(style, styleUrl, defaultStyle, sharedStyles,
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<module:ol/style/Style>|string|undefined} styleValue Style value.
|
||||
* @param {Array.<module:ol/style/Style>} defaultStyle Default style.
|
||||
* @param {!Object.<string, (Array.<module:ol/style/Style>|string)>} sharedStyles
|
||||
* @param {Array<module:ol/style/Style>|string|undefined} styleValue Style value.
|
||||
* @param {Array<module:ol/style/Style>} defaultStyle Default style.
|
||||
* @param {!Object.<string, (Array<module:ol/style/Style>|string)>} sharedStyles
|
||||
* Shared styles.
|
||||
* @return {Array.<module:ol/style/Style>} Style.
|
||||
* @return {Array<module:ol/style/Style>} Style.
|
||||
*/
|
||||
function findStyle(styleValue, defaultStyle, sharedStyles) {
|
||||
if (Array.isArray(styleValue)) {
|
||||
@@ -1009,7 +1009,7 @@ function readColor(node) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @return {Array.<number>|undefined} Flat coordinates.
|
||||
* @return {Array<number>|undefined} Flat coordinates.
|
||||
*/
|
||||
export function readFlatCoordinates(node) {
|
||||
let s = getAllTextContent(node, false);
|
||||
@@ -1104,8 +1104,8 @@ const STYLE_MAP_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<module:ol/style/Style>|string|undefined} StyleMap.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<module:ol/style/Style>|string|undefined} StyleMap.
|
||||
*/
|
||||
function readStyleMapValue(node, objectStack) {
|
||||
return pushParseAndPop(undefined,
|
||||
@@ -1128,7 +1128,7 @@ const ICON_STYLE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function iconStyleParser(node, objectStack) {
|
||||
// FIXME refreshMode
|
||||
@@ -1242,7 +1242,7 @@ const LABEL_STYLE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function labelStyleParser(node, objectStack) {
|
||||
// FIXME colorMode
|
||||
@@ -1277,7 +1277,7 @@ const LINE_STYLE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function lineStyleParser(node, objectStack) {
|
||||
// FIXME colorMode
|
||||
@@ -1314,7 +1314,7 @@ const POLY_STYLE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function polyStyleParser(node, objectStack) {
|
||||
// FIXME colorMode
|
||||
@@ -1352,8 +1352,8 @@ const FLAT_LINEAR_RING_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<number>} LinearRing flat coordinates.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<number>} LinearRing flat coordinates.
|
||||
*/
|
||||
function readFlatLinearRing(node, objectStack) {
|
||||
return pushParseAndPop(null,
|
||||
@@ -1363,7 +1363,7 @@ function readFlatLinearRing(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function gxCoordParser(node, objectStack) {
|
||||
const gxTrackObject = /** @type {module:ol/format/KML~GxTrackObject} */
|
||||
@@ -1396,7 +1396,7 @@ const GX_MULTITRACK_GEOMETRY_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
||||
*/
|
||||
function readGxMultiTrack(node, objectStack) {
|
||||
@@ -1424,7 +1424,7 @@ const GX_TRACK_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/LineString|undefined} LineString.
|
||||
*/
|
||||
function readGxTrack(node, objectStack) {
|
||||
@@ -1463,7 +1463,7 @@ const ICON_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object} Icon object.
|
||||
*/
|
||||
function readIcon(node, objectStack) {
|
||||
@@ -1489,8 +1489,8 @@ const GEOMETRY_FLAT_COORDINATES_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<number>} Flat coordinates.
|
||||
*/
|
||||
function readFlatCoordinatesFromNode(node, objectStack) {
|
||||
return pushParseAndPop(null,
|
||||
@@ -1512,7 +1512,7 @@ const EXTRUDE_AND_ALTITUDE_MODE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/LineString|undefined} LineString.
|
||||
*/
|
||||
function readLineString(node, objectStack) {
|
||||
@@ -1533,7 +1533,7 @@ function readLineString(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
||||
*/
|
||||
function readLinearRing(node, objectStack) {
|
||||
@@ -1568,7 +1568,7 @@ const MULTI_GEOMETRY_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/Geometry} Geometry.
|
||||
*/
|
||||
function readMultiGeometry(node, objectStack) {
|
||||
@@ -1627,7 +1627,7 @@ function readMultiGeometry(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/Point|undefined} Point.
|
||||
*/
|
||||
function readPoint(node, objectStack) {
|
||||
@@ -1659,7 +1659,7 @@ const FLAT_LINEAR_RINGS_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
||||
*/
|
||||
function readPolygon(node, objectStack) {
|
||||
@@ -1699,8 +1699,8 @@ const STYLE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<module:ol/style/Style>} Style.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<module:ol/style/Style>} Style.
|
||||
*/
|
||||
function readStyle(node, objectStack) {
|
||||
const styleObject = pushParseAndPop(
|
||||
@@ -1746,7 +1746,7 @@ function readStyle(node, objectStack) {
|
||||
* Reads an array of geometries and creates arrays for common geometry
|
||||
* properties. Then sets them to the multi geometry.
|
||||
* @param {module:ol/geom/MultiPoint|module:ol/geom/MultiLineString|module:ol/geom/MultiPolygon} multiGeometry A multi-geometry.
|
||||
* @param {Array.<module:ol/geom/Geometry>} geometries List of geometries.
|
||||
* @param {Array<module:ol/geom/Geometry>} geometries List of geometries.
|
||||
*/
|
||||
function setCommonGeometryProperties(multiGeometry, geometries) {
|
||||
const ii = geometries.length;
|
||||
@@ -1789,7 +1789,7 @@ const DATA_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function dataParser(node, objectStack) {
|
||||
const name = node.getAttribute('name');
|
||||
@@ -1817,7 +1817,7 @@ const EXTENDED_DATA_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function extendedDataParser(node, objectStack) {
|
||||
parseNode(EXTENDED_DATA_PARSERS, node, objectStack);
|
||||
@@ -1825,7 +1825,7 @@ function extendedDataParser(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function regionParser(node, objectStack) {
|
||||
parseNode(REGION_PARSERS, node, objectStack);
|
||||
@@ -1845,7 +1845,7 @@ const PAIR_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function pairDataParser(node, objectStack) {
|
||||
const pairObject = pushParseAndPop(
|
||||
@@ -1872,7 +1872,7 @@ function pairDataParser(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function placemarkStyleMapParser(node, objectStack) {
|
||||
const styleMapValue = readStyleMapValue(node, objectStack);
|
||||
@@ -1902,7 +1902,7 @@ const SCHEMA_DATA_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function schemaDataParser(node, objectStack) {
|
||||
parseNode(SCHEMA_DATA_PARSERS, node, objectStack);
|
||||
@@ -1911,7 +1911,7 @@ function schemaDataParser(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function simpleDataParser(node, objectStack) {
|
||||
const name = node.getAttribute('name');
|
||||
@@ -1941,7 +1941,7 @@ const LAT_LON_ALT_BOX_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function latLonAltBoxParser(node, objectStack) {
|
||||
const object = pushParseAndPop({}, LAT_LON_ALT_BOX_PARSERS, node, objectStack);
|
||||
@@ -1977,7 +1977,7 @@ const LOD_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function lodParser(node, objectStack) {
|
||||
const object = pushParseAndPop({}, LOD_PARSERS, node, objectStack);
|
||||
@@ -2004,14 +2004,14 @@ const INNER_BOUNDARY_IS_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function innerBoundaryIsParser(node, objectStack) {
|
||||
/** @type {Array.<number>|undefined} */
|
||||
/** @type {Array<number>|undefined} */
|
||||
const flatLinearRing = pushParseAndPop(undefined,
|
||||
INNER_BOUNDARY_IS_PARSERS, node, objectStack);
|
||||
if (flatLinearRing) {
|
||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
flatLinearRings.push(flatLinearRing);
|
||||
}
|
||||
@@ -2030,14 +2030,14 @@ const OUTER_BOUNDARY_IS_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function outerBoundaryIsParser(node, objectStack) {
|
||||
/** @type {Array.<number>|undefined} */
|
||||
/** @type {Array<number>|undefined} */
|
||||
const flatLinearRing = pushParseAndPop(undefined,
|
||||
OUTER_BOUNDARY_IS_PARSERS, node, objectStack);
|
||||
if (flatLinearRing) {
|
||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
flatLinearRings[0] = flatLinearRing;
|
||||
}
|
||||
@@ -2046,7 +2046,7 @@ function outerBoundaryIsParser(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function linkParser(node, objectStack) {
|
||||
parseNode(LINK_PARSERS, node, objectStack);
|
||||
@@ -2055,7 +2055,7 @@ function linkParser(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function whenParser(node, objectStack) {
|
||||
const gxTrackObject = /** @type {module:ol/format/KML~GxTrackObject} */
|
||||
@@ -2085,8 +2085,8 @@ function writeColorTextNode(node, color) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node to append a TextNode with the coordinates to.
|
||||
* @param {Array.<number>} coordinates Coordinates.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<number>} coordinates Coordinates.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeCoordinatesTextNode(node, coordinates, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -2138,7 +2138,7 @@ const EXTENDEDDATA_NODE_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {{name: *, value: *}} pair Name value pair.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeDataNode(node, pair, objectStack) {
|
||||
node.setAttribute('name', pair.name);
|
||||
@@ -2193,7 +2193,7 @@ const DOCUMENT_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @const
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node|undefined} Node.
|
||||
*/
|
||||
@@ -2205,8 +2205,8 @@ const DOCUMENT_NODE_FACTORY = function(value, objectStack, opt_nodeName) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @this {module:ol/format/KML}
|
||||
*/
|
||||
function writeDocument(node, features, objectStack) {
|
||||
@@ -2220,7 +2220,7 @@ function writeDocument(node, features, objectStack) {
|
||||
/**
|
||||
* A factory for creating Data nodes.
|
||||
* @const
|
||||
* @type {function(*, Array.<*>): (Node|undefined)}
|
||||
* @type {function(*, Array<*>): (Node|undefined)}
|
||||
*/
|
||||
const DATA_NODE_FACTORY = makeSimpleNodeFactory('Data');
|
||||
|
||||
@@ -2228,7 +2228,7 @@ const DATA_NODE_FACTORY = makeSimpleNodeFactory('Data');
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {{names: Array<string>, values: (Array<*>)}} namesAndValues Names and values.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeExtendedData(node, namesAndValues, objectStack) {
|
||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||
@@ -2245,7 +2245,7 @@ function writeExtendedData(node, namesAndValues, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const ICON_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -2275,7 +2275,7 @@ const ICON_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @const
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node|undefined} Node.
|
||||
*/
|
||||
@@ -2288,7 +2288,7 @@ const GX_NODE_FACTORY = function(value, objectStack, opt_nodeName) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Object} icon Icon object.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeIcon(node, icon, objectStack) {
|
||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||
@@ -2308,7 +2308,7 @@ function writeIcon(node, icon, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const ICON_STYLE_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -2332,7 +2332,7 @@ const ICON_STYLE_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/style/Icon} style Icon style.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeIconStyle(node, style, objectStack) {
|
||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||
@@ -2388,7 +2388,7 @@ function writeIconStyle(node, style, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const LABEL_STYLE_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -2410,7 +2410,7 @@ const LABEL_STYLE_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/style/Text} style style.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeLabelStyle(node, style, objectStack) {
|
||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||
@@ -2434,7 +2434,7 @@ function writeLabelStyle(node, style, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const LINE_STYLE_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -2456,7 +2456,7 @@ const LINE_STYLE_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/style/Stroke} style style.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeLineStyle(node, style, objectStack) {
|
||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||
@@ -2491,7 +2491,7 @@ const GEOMETRY_TYPE_TO_NODENAME = {
|
||||
/**
|
||||
* @const
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node|undefined} Node.
|
||||
*/
|
||||
@@ -2507,7 +2507,7 @@ const GEOMETRY_NODE_FACTORY = function(value, objectStack, opt_nodeName) {
|
||||
/**
|
||||
* A factory for creating Point nodes.
|
||||
* @const
|
||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
||||
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||
*/
|
||||
const POINT_NODE_FACTORY = makeSimpleNodeFactory('Point');
|
||||
|
||||
@@ -2515,7 +2515,7 @@ const POINT_NODE_FACTORY = makeSimpleNodeFactory('Point');
|
||||
/**
|
||||
* A factory for creating LineString nodes.
|
||||
* @const
|
||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
||||
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||
*/
|
||||
const LINE_STRING_NODE_FACTORY = makeSimpleNodeFactory('LineString');
|
||||
|
||||
@@ -2523,7 +2523,7 @@ const LINE_STRING_NODE_FACTORY = makeSimpleNodeFactory('LineString');
|
||||
/**
|
||||
* A factory for creating LinearRing nodes.
|
||||
* @const
|
||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
||||
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||
*/
|
||||
const LINEAR_RING_NODE_FACTORY = makeSimpleNodeFactory('LinearRing');
|
||||
|
||||
@@ -2531,7 +2531,7 @@ const LINEAR_RING_NODE_FACTORY = makeSimpleNodeFactory('LinearRing');
|
||||
/**
|
||||
* A factory for creating Polygon nodes.
|
||||
* @const
|
||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
||||
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||
*/
|
||||
const POLYGON_NODE_FACTORY = makeSimpleNodeFactory('Polygon');
|
||||
|
||||
@@ -2555,15 +2555,15 @@ const MULTI_GEOMETRY_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeMultiGeometry(node, geometry, objectStack) {
|
||||
/** @type {module:ol/xml~NodeStackItem} */
|
||||
const context = {node: node};
|
||||
const type = geometry.getType();
|
||||
/** @type {Array.<module:ol/geom/Geometry>} */
|
||||
/** @type {Array<module:ol/geom/Geometry>} */
|
||||
let geometries;
|
||||
/** @type {function(*, Array.<*>, string=): (Node|undefined)} */
|
||||
/** @type {function(*, Array<*>, string=): (Node|undefined)} */
|
||||
let factory;
|
||||
if (type == GeometryType.GEOMETRY_COLLECTION) {
|
||||
geometries = /** @type {module:ol/geom/GeometryCollection} */ (geometry).getGeometries();
|
||||
@@ -2602,7 +2602,7 @@ const BOUNDARY_IS_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LinearRing} linearRing Linear ring.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeBoundaryIs(node, linearRing, objectStack) {
|
||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||
@@ -2637,7 +2637,7 @@ const PLACEMARK_SERIALIZERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const PLACEMARK_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -2649,7 +2649,7 @@ const PLACEMARK_SEQUENCE = makeStructureNS(
|
||||
/**
|
||||
* A factory for creating ExtendedData nodes.
|
||||
* @const
|
||||
* @type {function(*, Array.<*>): (Node|undefined)}
|
||||
* @type {function(*, Array<*>): (Node|undefined)}
|
||||
*/
|
||||
const EXTENDEDDATA_NODE_FACTORY = makeSimpleNodeFactory('ExtendedData');
|
||||
|
||||
@@ -2659,7 +2659,7 @@ const EXTENDEDDATA_NODE_FACTORY = makeSimpleNodeFactory('ExtendedData');
|
||||
* (ExtendedData).
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @this {module:ol/format/KML}
|
||||
*/
|
||||
function writePlacemark(node, feature, objectStack) {
|
||||
@@ -2723,7 +2723,7 @@ function writePlacemark(node, feature, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const PRIMITIVE_GEOMETRY_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -2747,7 +2747,7 @@ const PRIMITIVE_GEOMETRY_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/SimpleGeometry} geometry Geometry.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writePrimitiveGeometry(node, geometry, objectStack) {
|
||||
const flatCoordinates = geometry.getFlatCoordinates();
|
||||
@@ -2783,7 +2783,7 @@ const POLYGON_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* A factory for creating innerBoundaryIs nodes.
|
||||
* @const
|
||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
||||
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||
*/
|
||||
const INNER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('innerBoundaryIs');
|
||||
|
||||
@@ -2791,7 +2791,7 @@ const INNER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('innerBoundaryIs');
|
||||
/**
|
||||
* A factory for creating outerBoundaryIs nodes.
|
||||
* @const
|
||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
||||
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||
*/
|
||||
const OUTER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('outerBoundaryIs');
|
||||
|
||||
@@ -2799,7 +2799,7 @@ const OUTER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('outerBoundaryIs');
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Polygon} polygon Polygon.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writePolygon(node, polygon, objectStack) {
|
||||
const linearRings = polygon.getLinearRings();
|
||||
@@ -2831,7 +2831,7 @@ const POLY_STYLE_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* A factory for creating coordinates nodes.
|
||||
* @const
|
||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
||||
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||
*/
|
||||
const COLOR_NODE_FACTORY = makeSimpleNodeFactory('color');
|
||||
|
||||
@@ -2839,7 +2839,7 @@ const COLOR_NODE_FACTORY = makeSimpleNodeFactory('color');
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/style/Fill} style Style.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writePolyStyle(node, style, objectStack) {
|
||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||
@@ -2861,7 +2861,7 @@ function writeScaleTextNode(node, scale) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const STYLE_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -2885,7 +2885,7 @@ const STYLE_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/style/Style} style Style.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeStyle(node, style, objectStack) {
|
||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||
|
||||
@@ -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((module:ol/geom/Geometry|Object.<string,*>)=)|function(module:ol/geom/GeometryType,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},
|
||||
@@ -32,7 +32,7 @@ import RenderFeature from '../render/Feature.js';
|
||||
* features.
|
||||
* @property {string} [layerName='layer'] Name of the feature attribute that
|
||||
* holds the layer name.
|
||||
* @property {Array.<string>} [layers] Layers to read features from. If not
|
||||
* @property {Array<string>} [layers] Layers to read features from. If not
|
||||
* provided, features will be read from all layers.
|
||||
*/
|
||||
|
||||
@@ -65,8 +65,8 @@ class MVT extends FeatureFormat {
|
||||
/**
|
||||
* @private
|
||||
* @type {function((module:ol/geom/Geometry|Object.<string,*>)=)|
|
||||
* function(module:ol/geom/GeometryType,Array.<number>,
|
||||
* (Array.<number>|Array.<Array.<number>>),Object.<string,*>,number)}
|
||||
* function(module:ol/geom/GeometryType,Array<number>,
|
||||
* (Array<number>|Array<Array<number>>),Object.<string,*>,number)}
|
||||
*/
|
||||
this.featureClass_ = options.featureClass ?
|
||||
options.featureClass : RenderFeature;
|
||||
@@ -85,7 +85,7 @@ class MVT extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
this.layers_ = options.layers ? options.layers : null;
|
||||
|
||||
@@ -103,8 +103,8 @@ class MVT extends FeatureFormat {
|
||||
* @suppress {missingProperties}
|
||||
* @param {Object} pbf PBF.
|
||||
* @param {Object} feature Raw feature.
|
||||
* @param {Array.<number>} flatCoordinates Array to store flat coordinates in.
|
||||
* @param {Array.<number>} ends Array to store ends in.
|
||||
* @param {Array<number>} flatCoordinates Array to store flat coordinates in.
|
||||
* @param {Array<number>} ends Array to store ends in.
|
||||
* @private
|
||||
*/
|
||||
readRawGeometry_(pbf, feature, flatCoordinates, ends) {
|
||||
@@ -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<module:ol/Feature|module:ol/render/Feature>} */
|
||||
const features = [];
|
||||
for (const name in pbfLayers) {
|
||||
if (layers && layers.indexOf(name) == -1) {
|
||||
@@ -280,7 +280,7 @@ class MVT extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* Sets the layers that features will be read from.
|
||||
* @param {Array.<string>} layers Layers.
|
||||
* @param {Array<string>} layers Layers.
|
||||
* @api
|
||||
*/
|
||||
setLayers(layers) {
|
||||
|
||||
@@ -17,7 +17,7 @@ import {pushParseAndPop, makeStructureNS} from '../xml.js';
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<null>}
|
||||
* @type {Array<null>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [null];
|
||||
|
||||
@@ -75,7 +75,7 @@ class OSMXML extends XMLFeature {
|
||||
// parse nodes in ways
|
||||
for (let j = 0; j < state.ways.length; j++) {
|
||||
const values = /** @type {Object} */ (state.ways[j]);
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const flatCoordinates = [];
|
||||
for (let i = 0, ii = values.ndrefs.length; i < ii; i++) {
|
||||
const point = state.nodes[values.ndrefs[i]];
|
||||
@@ -133,7 +133,7 @@ const NODE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function readNode(node, objectStack) {
|
||||
const options = /** @type {module:ol/format/Feature~ReadOptions} */ (objectStack[0]);
|
||||
@@ -162,7 +162,7 @@ function readNode(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function readWay(node, objectStack) {
|
||||
const id = node.getAttribute('id');
|
||||
@@ -178,7 +178,7 @@ function readWay(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function readNd(node, objectStack) {
|
||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
@@ -188,7 +188,7 @@ function readNd(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function readTag(node, objectStack) {
|
||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
|
||||
@@ -9,7 +9,7 @@ import {makeObjectPropertyPusher, makeObjectPropertySetter, makeStructureNS, pus
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<null|string>}
|
||||
* @type {Array<null|string>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [null, 'http://www.opengis.net/ows/1.1'];
|
||||
|
||||
@@ -206,7 +206,7 @@ const SERVICE_PROVIDER_PARSERS =
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The address.
|
||||
*/
|
||||
function readAddress(node, objectStack) {
|
||||
@@ -217,7 +217,7 @@ function readAddress(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The values.
|
||||
*/
|
||||
function readAllowedValues(node, objectStack) {
|
||||
@@ -228,7 +228,7 @@ function readAllowedValues(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The constraint.
|
||||
*/
|
||||
function readConstraint(node, objectStack) {
|
||||
@@ -244,7 +244,7 @@ function readConstraint(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The contact info.
|
||||
*/
|
||||
function readContactInfo(node, objectStack) {
|
||||
@@ -255,7 +255,7 @@ function readContactInfo(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The DCP.
|
||||
*/
|
||||
function readDcp(node, objectStack) {
|
||||
@@ -266,7 +266,7 @@ function readDcp(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The GET object.
|
||||
*/
|
||||
function readGet(node, objectStack) {
|
||||
@@ -281,7 +281,7 @@ function readGet(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The HTTP object.
|
||||
*/
|
||||
function readHttp(node, objectStack) {
|
||||
@@ -291,7 +291,7 @@ function readHttp(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The operation.
|
||||
*/
|
||||
function readOperation(node, objectStack) {
|
||||
@@ -309,7 +309,7 @@ function readOperation(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The operations metadata.
|
||||
*/
|
||||
function readOperationsMetadata(node, objectStack) {
|
||||
@@ -321,7 +321,7 @@ function readOperationsMetadata(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The phone.
|
||||
*/
|
||||
function readPhone(node, objectStack) {
|
||||
@@ -332,7 +332,7 @@ function readPhone(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The service identification.
|
||||
*/
|
||||
function readServiceIdentification(node, objectStack) {
|
||||
@@ -344,7 +344,7 @@ function readServiceIdentification(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The service contact.
|
||||
*/
|
||||
function readServiceContact(node, objectStack) {
|
||||
@@ -356,7 +356,7 @@ function readServiceContact(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The service provider.
|
||||
*/
|
||||
function readServiceProvider(node, objectStack) {
|
||||
@@ -368,7 +368,7 @@ function readServiceProvider(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {string|undefined} The value.
|
||||
*/
|
||||
function readValue(node, objectStack) {
|
||||
|
||||
@@ -138,7 +138,7 @@ class Polyline extends TextFeature {
|
||||
*
|
||||
* Attention: This function will modify the passed array!
|
||||
*
|
||||
* @param {Array.<number>} numbers A list of n-dimensional points.
|
||||
* @param {Array<number>} numbers A list of n-dimensional points.
|
||||
* @param {number} stride The number of dimension of the points in the list.
|
||||
* @param {number=} opt_factor The factor by which the numbers will be
|
||||
* multiplied. The remaining decimal places will get rounded away.
|
||||
@@ -177,14 +177,14 @@ export function encodeDeltas(numbers, stride, opt_factor) {
|
||||
* encoded string.
|
||||
* @param {number=} opt_factor The factor by which the resulting numbers will
|
||||
* be divided. Default is `1e5`.
|
||||
* @return {Array.<number>} A list of n-dimensional points.
|
||||
* @return {Array<number>} A list of n-dimensional points.
|
||||
* @api
|
||||
*/
|
||||
export function decodeDeltas(encoded, stride, opt_factor) {
|
||||
const factor = opt_factor ? opt_factor : 1e5;
|
||||
let d;
|
||||
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const lastNumbers = new Array(stride);
|
||||
for (d = 0; d < stride; ++d) {
|
||||
lastNumbers[d] = 0;
|
||||
@@ -209,7 +209,7 @@ export function decodeDeltas(encoded, stride, opt_factor) {
|
||||
*
|
||||
* Attention: This function will modify the passed array!
|
||||
*
|
||||
* @param {Array.<number>} numbers A list of floating point numbers.
|
||||
* @param {Array<number>} numbers A list of floating point numbers.
|
||||
* @param {number=} opt_factor The factor by which the numbers will be
|
||||
* multiplied. The remaining decimal places will get rounded away.
|
||||
* Default is `1e5`.
|
||||
@@ -232,7 +232,7 @@ export function encodeFloats(numbers, opt_factor) {
|
||||
* @param {string} encoded An encoded string.
|
||||
* @param {number=} opt_factor The factor by which the result will be divided.
|
||||
* Default is `1e5`.
|
||||
* @return {Array.<number>} A list of floating point numbers.
|
||||
* @return {Array<number>} A list of floating point numbers.
|
||||
* @api
|
||||
*/
|
||||
export function decodeFloats(encoded, opt_factor) {
|
||||
@@ -250,7 +250,7 @@ export function decodeFloats(encoded, opt_factor) {
|
||||
*
|
||||
* Attention: This function will modify the passed array!
|
||||
*
|
||||
* @param {Array.<number>} numbers A list of signed integers.
|
||||
* @param {Array<number>} numbers A list of signed integers.
|
||||
* @return {string} The encoded string.
|
||||
*/
|
||||
export function encodeSignedIntegers(numbers) {
|
||||
@@ -266,7 +266,7 @@ export function encodeSignedIntegers(numbers) {
|
||||
* Decode a list of signed integers from an encoded string
|
||||
*
|
||||
* @param {string} encoded An encoded string.
|
||||
* @return {Array.<number>} A list of signed integers.
|
||||
* @return {Array<number>} A list of signed integers.
|
||||
*/
|
||||
export function decodeSignedIntegers(encoded) {
|
||||
const numbers = decodeUnsignedIntegers(encoded);
|
||||
@@ -281,7 +281,7 @@ export function decodeSignedIntegers(encoded) {
|
||||
/**
|
||||
* Encode a list of unsigned integers and return an encoded string
|
||||
*
|
||||
* @param {Array.<number>} numbers A list of unsigned integers.
|
||||
* @param {Array<number>} numbers A list of unsigned integers.
|
||||
* @return {string} The encoded string.
|
||||
*/
|
||||
export function encodeUnsignedIntegers(numbers) {
|
||||
@@ -297,7 +297,7 @@ export function encodeUnsignedIntegers(numbers) {
|
||||
* Decode a list of unsigned integers from an encoded string
|
||||
*
|
||||
* @param {string} encoded An encoded string.
|
||||
* @return {Array.<number>} A list of unsigned integers.
|
||||
* @return {Array<number>} A list of unsigned integers.
|
||||
*/
|
||||
export function decodeUnsignedIntegers(encoded) {
|
||||
const numbers = [];
|
||||
|
||||
@@ -50,7 +50,7 @@ class TextFeature extends FeatureFormat {
|
||||
*
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
readFeatures(source, opt_options) {
|
||||
@@ -62,7 +62,7 @@ class TextFeature extends FeatureFormat {
|
||||
* @param {string} text Text.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @protected
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
*/
|
||||
readFeaturesFromText(text, opt_options) {}
|
||||
|
||||
@@ -133,7 +133,7 @@ class TextFeature extends FeatureFormat {
|
||||
/**
|
||||
* Encode an array of features as string.
|
||||
*
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {string} Encoded features.
|
||||
* @api
|
||||
@@ -144,7 +144,7 @@ class TextFeature extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @protected
|
||||
* @return {string} Text.
|
||||
|
||||
@@ -32,7 +32,7 @@ import {get as getProjection} from '../proj.js';
|
||||
* ```
|
||||
* will result in features that have a property `'layer'` set to `'example'`.
|
||||
* When not set, no property will be added to features.
|
||||
* @property {Array.<string>} [layers] Names of the TopoJSON topology's
|
||||
* @property {Array<string>} [layers] Names of the TopoJSON topology's
|
||||
* `objects`'s children to read features from. If not provided, features will
|
||||
* be read from all children.
|
||||
*/
|
||||
@@ -62,7 +62,7 @@ class TopoJSON extends JSONFeature {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
this.layers_ = options.layers ? options.layers : null;
|
||||
|
||||
@@ -91,7 +91,7 @@ class TopoJSON extends JSONFeature {
|
||||
if (transform) {
|
||||
transformArcs(arcs, scale, translate);
|
||||
}
|
||||
/** @type {Array.<module:ol/Feature>} */
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
const features = [];
|
||||
const topoJSONFeatures = topoJSONTopology.objects;
|
||||
const property = this.layerName_;
|
||||
@@ -171,14 +171,14 @@ const GEOMETRY_READERS = {
|
||||
|
||||
/**
|
||||
* Concatenate arcs into a coordinate array.
|
||||
* @param {Array.<number>} indices Indices of arcs to concatenate. Negative
|
||||
* @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<module:ol/coordinate~Coordinate>>} arcs Array of arcs (already
|
||||
* transformed).
|
||||
* @return {Array.<module:ol/coordinate~Coordinate>} Coordinates array.
|
||||
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates array.
|
||||
*/
|
||||
function concatenateArcs(indices, arcs) {
|
||||
/** @type {Array.<module:ol/coordinate~Coordinate>} */
|
||||
/** @type {Array<module:ol/coordinate~Coordinate>} */
|
||||
const coordinates = [];
|
||||
let index, arc;
|
||||
for (let i = 0, ii = indices.length; i < ii; ++i) {
|
||||
@@ -208,8 +208,8 @@ function concatenateArcs(indices, arcs) {
|
||||
* Create a point from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
* @return {module:ol/geom/Point} Geometry.
|
||||
*/
|
||||
function readPointGeometry(object, scale, translate) {
|
||||
@@ -225,8 +225,8 @@ function readPointGeometry(object, scale, translate) {
|
||||
* Create a multi-point from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
* @return {module:ol/geom/MultiPoint} Geometry.
|
||||
*/
|
||||
function readMultiPointGeometry(object, scale, translate) {
|
||||
@@ -244,7 +244,7 @@ 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.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @return {module:ol/geom/LineString} Geometry.
|
||||
*/
|
||||
function readLineStringGeometry(object, arcs) {
|
||||
@@ -257,7 +257,7 @@ 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.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @return {module:ol/geom/MultiLineString} Geometry.
|
||||
*/
|
||||
function readMultiLineStringGeometry(object, arcs) {
|
||||
@@ -273,7 +273,7 @@ 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.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @return {module:ol/geom/Polygon} Geometry.
|
||||
*/
|
||||
function readPolygonGeometry(object, arcs) {
|
||||
@@ -289,7 +289,7 @@ 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.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @return {module:ol/geom/MultiPolygon} Geometry.
|
||||
*/
|
||||
function readMultiPolygonGeometry(object, arcs) {
|
||||
@@ -313,14 +313,14 @@ function readMultiPolygonGeometry(object, arcs) {
|
||||
*
|
||||
* @param {TopoJSONGeometryCollection} collection TopoJSON Geometry
|
||||
* object.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<Array<module:ol/coordinate~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.
|
||||
* @return {Array<module:ol/Feature>} Array of features.
|
||||
*/
|
||||
function readFeaturesFromGeometryCollection(collection, arcs, scale, translate, property, name, opt_options) {
|
||||
const geometries = collection.geometries;
|
||||
@@ -337,9 +337,9 @@ 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.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<Array<module:ol/coordinate~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.
|
||||
@@ -379,9 +379,9 @@ 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.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
*/
|
||||
function transformArcs(arcs, scale, translate) {
|
||||
for (let i = 0, ii = arcs.length; i < ii; ++i) {
|
||||
@@ -393,9 +393,9 @@ 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.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<module:ol/coordinate~Coordinate>} arc Arc.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
*/
|
||||
function transformArc(arc, scale, translate) {
|
||||
let x = 0;
|
||||
@@ -416,8 +416,8 @@ function transformArc(arc, scale, translate) {
|
||||
* place.
|
||||
*
|
||||
* @param {module:ol/coordinate~Coordinate} vertex Vertex.
|
||||
* @param {Array.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
*/
|
||||
function transformVertex(vertex, scale, translate) {
|
||||
vertex[0] = vertex[0] * scale[0] + translate[0];
|
||||
|
||||
@@ -82,7 +82,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 {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 {string} [schemaLocation] Optional schemaLocation to use for serialization, this will override the default.
|
||||
*/
|
||||
@@ -92,14 +92,14 @@ const TRANSACTION_SERIALIZERS = {
|
||||
* @typedef {Object} WriteGetFeatureOptions
|
||||
* @property {string} featureNS The namespace URI used for features.
|
||||
* @property {string} featurePrefix The prefix for the feature namespace.
|
||||
* @property {Array.<string>} featureTypes The feature type names.
|
||||
* @property {Array<string>} featureTypes The feature type names.
|
||||
* @property {string} [srsName] SRS name. No srsName attribute will be set on
|
||||
* geometries when this is not provided.
|
||||
* @property {string} [handle] Handle.
|
||||
* @property {string} [outputFormat] Output format.
|
||||
* @property {number} [maxFeatures] Maximum number of features to fetch.
|
||||
* @property {string} [geometryName] Geometry name to use in a BBOX filter.
|
||||
* @property {Array.<string>} [propertyNames] Optional list of property names to serialize.
|
||||
* @property {Array<string>} [propertyNames] Optional list of property names to serialize.
|
||||
* @property {number} [startIndex] Start index to use for WFS paging. This is a
|
||||
* WFS 2.0 feature backported to WFS 1.1.0 by some Web Feature Services.
|
||||
* @property {number} [count] Number of features to retrieve when paging. This is a
|
||||
@@ -123,7 +123,7 @@ const TRANSACTION_SERIALIZERS = {
|
||||
* @property {string} [handle] Handle.
|
||||
* @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 {Array<Object>} nativeElements Native elements. Currently not supported.
|
||||
* @property {module:ol/format/GMLBase~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`.
|
||||
*/
|
||||
@@ -143,7 +143,7 @@ const TRANSACTION_SERIALIZERS = {
|
||||
* @property {number} totalDeleted
|
||||
* @property {number} totalInserted
|
||||
* @property {number} totalUpdated
|
||||
* @property {Array.<string>} insertIds
|
||||
* @property {Array<string>} insertIds
|
||||
*/
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ class WFS extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<string>|string|undefined}
|
||||
* @type {Array<string>|string|undefined}
|
||||
*/
|
||||
this.featureType_ = options.featureType;
|
||||
|
||||
@@ -240,14 +240,14 @@ class WFS extends XMLFeature {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array.<string>|string|undefined} featureType
|
||||
* @return {Array<string>|string|undefined} featureType
|
||||
*/
|
||||
getFeatureType() {
|
||||
return this.featureType_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<string>|string|undefined} featureType Feature type(s) to parse.
|
||||
* @param {Array<string>|string|undefined} featureType Feature type(s) to parse.
|
||||
*/
|
||||
setFeatureType(featureType) {
|
||||
this.featureType_ = featureType;
|
||||
@@ -429,16 +429,16 @@ class WFS extends XMLFeature {
|
||||
};
|
||||
assert(Array.isArray(options.featureTypes),
|
||||
11); // `options.featureTypes` should be an Array
|
||||
writeGetFeature(node, /** @type {!Array.<string>} */ (options.featureTypes), [context]);
|
||||
writeGetFeature(node, /** @type {!Array<string>} */ (options.featureTypes), [context]);
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 {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.
|
||||
* @return {Node} Result.
|
||||
* @api
|
||||
@@ -538,7 +538,7 @@ class WFS extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Transaction Summary.
|
||||
*/
|
||||
function readTransactionSummary(node, objectStack) {
|
||||
@@ -562,7 +562,7 @@ const OGC_FID_PARSERS = {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function fidParser(node, objectStack) {
|
||||
parseNode(OGC_FID_PARSERS, node, objectStack);
|
||||
@@ -582,8 +582,8 @@ const INSERT_RESULTS_PARSERS = {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<string>|undefined} Insert results.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<string>|undefined} Insert results.
|
||||
*/
|
||||
function readInsertResults(node, objectStack) {
|
||||
return pushParseAndPop(
|
||||
@@ -594,7 +594,7 @@ function readInsertResults(node, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeFeature(node, feature, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -614,7 +614,7 @@ function writeFeature(node, feature, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {number|string} fid Feature identifier.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeOgcFidFilter(node, fid, objectStack) {
|
||||
const filter = createElementNS(OGCNS, 'Filter');
|
||||
@@ -645,7 +645,7 @@ function getTypeName(featurePrefix, featureType) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeDelete(node, feature, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -666,7 +666,7 @@ function writeDelete(node, feature, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeUpdate(node, feature, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -706,7 +706,7 @@ function writeUpdate(node, feature, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Object} pair Property name and value.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeProperty(node, pair, objectStack) {
|
||||
const name = createElementNS(WFSNS, 'Name');
|
||||
@@ -735,7 +735,7 @@ function writeProperty(node, pair, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {{vendorId: string, safeToIgnore: boolean, value: string}} nativeElement The native element.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeNative(node, nativeElement, objectStack) {
|
||||
if (nativeElement.vendorId) {
|
||||
@@ -782,7 +782,7 @@ const GETFEATURE_SERIALIZERS = {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {string} featureType Feature type.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeQuery(node, featureType, objectStack) {
|
||||
const context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
@@ -822,7 +822,7 @@ function writeQuery(node, featureType, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/Filter} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeFilterCondition(node, filter, objectStack) {
|
||||
/** @type {module:ol/xml~NodeStackItem} */
|
||||
@@ -837,7 +837,7 @@ function writeFilterCondition(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/Bbox} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeBboxFilter(node, filter, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -851,7 +851,7 @@ function writeBboxFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/Contains} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeContainsFilter(node, filter, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -865,7 +865,7 @@ function writeContainsFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/Intersects} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeIntersectsFilter(node, filter, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -879,7 +879,7 @@ function writeIntersectsFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/Within} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeWithinFilter(node, filter, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -893,7 +893,7 @@ function writeWithinFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/During} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeDuringFilter(node, filter, objectStack) {
|
||||
|
||||
@@ -918,7 +918,7 @@ function writeDuringFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/LogicalNary} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeLogicalFilter(node, filter, objectStack) {
|
||||
/** @type {module:ol/xml~NodeStackItem} */
|
||||
@@ -937,7 +937,7 @@ function writeLogicalFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/Not} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeNotFilter(node, filter, objectStack) {
|
||||
/** @type {module:ol/xml~NodeStackItem} */
|
||||
@@ -953,7 +953,7 @@ function writeNotFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/ComparisonBinary} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeComparisonFilter(node, filter, objectStack) {
|
||||
if (filter.matchCase !== undefined) {
|
||||
@@ -967,7 +967,7 @@ function writeComparisonFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/IsNull} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeIsNullFilter(node, filter, objectStack) {
|
||||
writeOgcPropertyName(node, filter.propertyName);
|
||||
@@ -977,7 +977,7 @@ function writeIsNullFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/IsBetween} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeIsBetweenFilter(node, filter, objectStack) {
|
||||
writeOgcPropertyName(node, filter.propertyName);
|
||||
@@ -995,7 +995,7 @@ function writeIsBetweenFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/IsLike} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeIsLikeFilter(node, filter, objectStack) {
|
||||
node.setAttribute('wildCard', filter.wildCard);
|
||||
@@ -1069,8 +1069,8 @@ export function writeFilter(filter) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<string>} featureTypes Feature types.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<string>} featureTypes Feature types.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeGetFeature(node, featureTypes, objectStack) {
|
||||
const context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
|
||||
@@ -321,7 +321,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<module:ol/geom/Geometry>} A collection of geometries.
|
||||
* @return {!Array<module:ol/geom/Geometry>} A collection of geometries.
|
||||
* @private
|
||||
*/
|
||||
parseGeometryCollectionText_() {
|
||||
@@ -340,7 +340,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array.<number>} All values in a point.
|
||||
* @return {Array<number>} All values in a point.
|
||||
* @private
|
||||
*/
|
||||
parsePointText_() {
|
||||
@@ -356,7 +356,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<!Array.<number>>} All points in a linestring.
|
||||
* @return {!Array<!Array<number>>} All points in a linestring.
|
||||
* @private
|
||||
*/
|
||||
parseLineStringText_() {
|
||||
@@ -372,7 +372,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<!Array.<number>>} All points in a polygon.
|
||||
* @return {!Array<!Array<number>>} All points in a polygon.
|
||||
* @private
|
||||
*/
|
||||
parsePolygonText_() {
|
||||
@@ -388,7 +388,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<!Array.<number>>} All points in a multipoint.
|
||||
* @return {!Array<!Array<number>>} All points in a multipoint.
|
||||
* @private
|
||||
*/
|
||||
parseMultiPointText_() {
|
||||
@@ -409,7 +409,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<!Array.<number>>} All linestring points
|
||||
* @return {!Array<!Array<number>>} All linestring points
|
||||
* in a multilinestring.
|
||||
* @private
|
||||
*/
|
||||
@@ -426,7 +426,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<!Array.<number>>} All polygon points in a multipolygon.
|
||||
* @return {!Array<!Array<number>>} All polygon points in a multipolygon.
|
||||
* @private
|
||||
*/
|
||||
parseMultiPolygonText_() {
|
||||
@@ -442,7 +442,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<number>} A point.
|
||||
* @return {!Array<number>} A point.
|
||||
* @private
|
||||
*/
|
||||
parsePoint_() {
|
||||
@@ -463,7 +463,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<!Array.<number>>} An array of points.
|
||||
* @return {!Array<!Array<number>>} An array of points.
|
||||
* @private
|
||||
*/
|
||||
parsePointList_() {
|
||||
@@ -475,7 +475,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<!Array.<number>>} An array of points.
|
||||
* @return {!Array<!Array<number>>} An array of points.
|
||||
* @private
|
||||
*/
|
||||
parsePointTextList_() {
|
||||
@@ -487,7 +487,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<!Array.<number>>} An array of points.
|
||||
* @return {!Array<!Array<number>>} An array of points.
|
||||
* @private
|
||||
*/
|
||||
parseLineStringTextList_() {
|
||||
@@ -499,7 +499,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<!Array.<number>>} An array of points.
|
||||
* @return {!Array<!Array<number>>} An array of points.
|
||||
* @private
|
||||
*/
|
||||
parsePolygonTextList_() {
|
||||
|
||||
@@ -10,7 +10,7 @@ import {makeArrayPusher, makeObjectPropertyPusher, makeObjectPropertySetter,
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<null|string>}
|
||||
* @type {Array<null|string>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [
|
||||
null,
|
||||
@@ -287,7 +287,7 @@ const KEYWORDLIST_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Attribution object.
|
||||
*/
|
||||
function readAttribution(node, objectStack) {
|
||||
@@ -297,7 +297,7 @@ function readAttribution(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object} Bounding box object.
|
||||
*/
|
||||
function readBoundingBox(node, objectStack) {
|
||||
@@ -323,7 +323,7 @@ function readBoundingBox(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/extent~Extent|undefined} Bounding box object.
|
||||
*/
|
||||
function readEXGeographicBoundingBox(node, objectStack) {
|
||||
@@ -355,7 +355,7 @@ function readEXGeographicBoundingBox(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Capability object.
|
||||
*/
|
||||
function readCapability(node, objectStack) {
|
||||
@@ -365,7 +365,7 @@ function readCapability(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Service object.
|
||||
*/
|
||||
function readService(node, objectStack) {
|
||||
@@ -375,7 +375,7 @@ function readService(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Contact information object.
|
||||
*/
|
||||
function readContactInformation(node, objectStack) {
|
||||
@@ -385,7 +385,7 @@ function readContactInformation(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Contact person object.
|
||||
*/
|
||||
function readContactPersonPrimary(node, objectStack) {
|
||||
@@ -395,7 +395,7 @@ function readContactPersonPrimary(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Contact address object.
|
||||
*/
|
||||
function readContactAddress(node, objectStack) {
|
||||
@@ -405,8 +405,8 @@ function readContactAddress(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<string>|undefined} Format array.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<string>|undefined} Format array.
|
||||
*/
|
||||
function readException(node, objectStack) {
|
||||
return pushParseAndPop([], EXCEPTION_PARSERS, node, objectStack);
|
||||
@@ -415,7 +415,7 @@ function readException(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Layer object.
|
||||
*/
|
||||
function readCapabilityLayer(node, objectStack) {
|
||||
@@ -425,7 +425,7 @@ function readCapabilityLayer(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Layer object.
|
||||
*/
|
||||
function readLayer(node, objectStack) {
|
||||
@@ -497,7 +497,7 @@ function readLayer(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object} Dimension object.
|
||||
*/
|
||||
function readDimension(node, objectStack) {
|
||||
@@ -517,7 +517,7 @@ function readDimension(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Online resource object.
|
||||
*/
|
||||
function readFormatOnlineresource(node, objectStack) {
|
||||
@@ -527,7 +527,7 @@ function readFormatOnlineresource(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Request object.
|
||||
*/
|
||||
function readRequest(node, objectStack) {
|
||||
@@ -537,7 +537,7 @@ function readRequest(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} DCP type object.
|
||||
*/
|
||||
function readDCPType(node, objectStack) {
|
||||
@@ -547,7 +547,7 @@ function readDCPType(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} HTTP object.
|
||||
*/
|
||||
function readHTTP(node, objectStack) {
|
||||
@@ -557,7 +557,7 @@ function readHTTP(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Operation type object.
|
||||
*/
|
||||
function readOperationType(node, objectStack) {
|
||||
@@ -567,7 +567,7 @@ function readOperationType(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Online resource object.
|
||||
*/
|
||||
function readSizedFormatOnlineresource(node, objectStack) {
|
||||
@@ -586,7 +586,7 @@ function readSizedFormatOnlineresource(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Authority URL object.
|
||||
*/
|
||||
function readAuthorityURL(node, objectStack) {
|
||||
@@ -601,7 +601,7 @@ function readAuthorityURL(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Metadata URL object.
|
||||
*/
|
||||
function readMetadataURL(node, objectStack) {
|
||||
@@ -616,7 +616,7 @@ function readMetadataURL(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Style object.
|
||||
*/
|
||||
function readStyle(node, objectStack) {
|
||||
@@ -626,8 +626,8 @@ function readStyle(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<string>|undefined} Keyword list.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<string>|undefined} Keyword list.
|
||||
*/
|
||||
function readKeywordList(node, objectStack) {
|
||||
return pushParseAndPop([], KEYWORDLIST_PARSERS, node, objectStack);
|
||||
|
||||
@@ -10,7 +10,7 @@ import {makeArrayPusher, makeStructureNS, pushParseAndPop} from '../xml.js';
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {Array.<string>} [layers] If set, only features of the given layers will be returned by the format when read.
|
||||
* @property {Array<string>} [layers] If set, only features of the given layers will be returned by the format when read.
|
||||
*/
|
||||
|
||||
|
||||
@@ -61,20 +61,20 @@ class WMSGetFeatureInfo extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
this.layers_ = options.layers ? options.layers : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array.<string>} layers
|
||||
* @return {Array<string>} layers
|
||||
*/
|
||||
getLayers() {
|
||||
return this.layers_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<string>} layers Layers to parse.
|
||||
* @param {Array<string>} layers Layers to parse.
|
||||
*/
|
||||
setLayers(layers) {
|
||||
this.layers_ = layers;
|
||||
@@ -82,14 +82,14 @@ class WMSGetFeatureInfo extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @private
|
||||
*/
|
||||
readFeatures_(node, objectStack) {
|
||||
node.setAttribute('namespaceURI', this.featureNS_);
|
||||
const localName = node.localName;
|
||||
/** @type {Array.<module:ol/Feature>} */
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
let features = [];
|
||||
if (node.childNodes.length === 0) {
|
||||
return features;
|
||||
|
||||
@@ -12,7 +12,7 @@ import {pushParseAndPop, makeStructureNS,
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<null|string>}
|
||||
* @type {Array<null|string>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [
|
||||
null,
|
||||
@@ -22,7 +22,7 @@ const NAMESPACE_URIS = [
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<null|string>}
|
||||
* @type {Array<null|string>}
|
||||
*/
|
||||
const OWS_NAMESPACE_URIS = [
|
||||
null,
|
||||
@@ -219,7 +219,7 @@ const TM_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Attribution object.
|
||||
*/
|
||||
function readContents(node, objectStack) {
|
||||
@@ -229,7 +229,7 @@ function readContents(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Layers object.
|
||||
*/
|
||||
function readLayer(node, objectStack) {
|
||||
@@ -239,7 +239,7 @@ function readLayer(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Tile Matrix Set object.
|
||||
*/
|
||||
function readTileMatrixSet(node, objectStack) {
|
||||
@@ -249,7 +249,7 @@ function readTileMatrixSet(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Style object.
|
||||
*/
|
||||
function readStyle(node, objectStack) {
|
||||
@@ -266,7 +266,7 @@ function readStyle(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Tile Matrix Set Link object.
|
||||
*/
|
||||
function readTileMatrixSetLink(node, objectStack) {
|
||||
@@ -276,7 +276,7 @@ function readTileMatrixSetLink(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Dimension object.
|
||||
*/
|
||||
function readDimensions(node, objectStack) {
|
||||
@@ -286,7 +286,7 @@ function readDimensions(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Resource URL object.
|
||||
*/
|
||||
function readResourceUrl(node, objectStack) {
|
||||
@@ -309,7 +309,7 @@ function readResourceUrl(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} WGS84 BBox object.
|
||||
*/
|
||||
function readWgs84BoundingBox(node, objectStack) {
|
||||
@@ -323,7 +323,7 @@ function readWgs84BoundingBox(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Legend object.
|
||||
*/
|
||||
function readLegendUrl(node, objectStack) {
|
||||
@@ -336,7 +336,7 @@ function readLegendUrl(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Coordinates object.
|
||||
*/
|
||||
function readCoordinates(node, objectStack) {
|
||||
@@ -355,7 +355,7 @@ function readCoordinates(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} TileMatrix object.
|
||||
*/
|
||||
function readTileMatrix(node, objectStack) {
|
||||
@@ -365,7 +365,7 @@ function readTileMatrix(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} TileMatrixSetLimits Object.
|
||||
*/
|
||||
function readTileMatrixLimitsList(node, objectStack) {
|
||||
@@ -375,7 +375,7 @@ function readTileMatrixLimitsList(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} TileMatrixLimits Array.
|
||||
*/
|
||||
function readTileMatrixLimits(node, objectStack) {
|
||||
|
||||
@@ -82,7 +82,7 @@ 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.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
readFeatures(source, opt_options) {
|
||||
@@ -103,10 +103,10 @@ class XMLFeature extends FeatureFormat {
|
||||
* @param {Document} doc Document.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||
* @protected
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
*/
|
||||
readFeaturesFromDocument(doc, opt_options) {
|
||||
/** @type {Array.<module:ol/Feature>} */
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
const features = [];
|
||||
for (let n = doc.firstChild; n; n = n.nextSibling) {
|
||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||
@@ -121,7 +121,7 @@ class XMLFeature extends FeatureFormat {
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||
* @protected
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
*/
|
||||
readFeaturesFromNode(node, opt_options) {}
|
||||
|
||||
@@ -221,7 +221,7 @@ class XMLFeature extends FeatureFormat {
|
||||
/**
|
||||
* Encode an array of features as string.
|
||||
*
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {string} Result.
|
||||
* @api
|
||||
@@ -232,7 +232,7 @@ class XMLFeature extends FeatureFormat {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @return {Node} Node.
|
||||
*/
|
||||
|
||||
@@ -22,7 +22,7 @@ class LogicalNary extends Filter {
|
||||
super(tagName);
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/format/filter/Filter>}
|
||||
* @type {Array<module:ol/format/filter/Filter>}
|
||||
*/
|
||||
this.conditions = Array.prototype.slice.call(arguments, 1);
|
||||
assert(this.conditions.length >= 2, 57); // At least 2 conditions are required.
|
||||
|
||||
Reference in New Issue
Block a user