From ca46c4dd076a4d091bb8d6a0f126dbcd2aaa50a1 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sun, 11 Mar 2018 22:26:22 -0600 Subject: [PATCH] Move WriteGetFeatureOptions to ol/format/WFS --- externs/olx.js | 136 ------------------------------------------- externs/xol.js | 24 -------- src/ol/format/WFS.js | 27 ++++++++- 3 files changed, 26 insertions(+), 161 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index 72f1cb37de..73a5109345 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -5,142 +5,6 @@ let olx; -/** - * @typedef {{featureNS: string, - * featurePrefix: string, - * featureTypes: Array., - * srsName: (string|undefined), - * handle: (string|undefined), - * outputFormat: (string|undefined), - * maxFeatures: (number|undefined), - * geometryName: (string|undefined), - * propertyNames: (Array.|undefined), - * startIndex: (number|undefined), - * count: (number|undefined), - * bbox: (ol.Extent|undefined), - * filter: (ol.format.filter.Filter|undefined), - * resultType: (string|undefined)}} - */ -olx.format.WFSWriteGetFeatureOptions; - - -/** - * The namespace URI used for features. - * @type {string} - * @api - */ -olx.format.WFSWriteGetFeatureOptions.prototype.featureNS; - - -/** - * The prefix for the feature namespace. - * @type {string} - * @api - */ -olx.format.WFSWriteGetFeatureOptions.prototype.featurePrefix; - - -/** - * The feature type names. - * @type {Array.} - * @api - */ -olx.format.WFSWriteGetFeatureOptions.prototype.featureTypes; - - -/** - * SRS name. No srsName attribute will be set on geometries when this is not - * provided. - * @type {string|undefined} - * @api - */ -olx.format.WFSWriteGetFeatureOptions.prototype.srsName; - - -/** - * Handle. - * @type {string|undefined} - * @api - */ -olx.format.WFSWriteGetFeatureOptions.prototype.handle; - - -/** - * Output format. - * @type {string|undefined} - * @api - */ -olx.format.WFSWriteGetFeatureOptions.prototype.outputFormat; - - -/** - * Maximum number of features to fetch. - * @type {number|undefined} - * @api - */ -olx.format.WFSWriteGetFeatureOptions.prototype.maxFeatures; - - -/** - * Geometry name to use in a BBOX filter. - * @type {string|undefined} - * @api - */ -olx.format.WFSWriteGetFeatureOptions.prototype.geometryName; - - -/** - * Optional list of property names to serialize. - * @type {Array.|undefined} - * @api - */ -olx.format.WFSWriteGetFeatureOptions.prototype.propertyNames; - - -/** - * 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. - * @type {number|undefined} - * @api - */ -olx.format.WFSWriteGetFeatureOptions.prototype.startIndex; - - -/** - * Number of features to retrieve when paging. This is a WFS 2.0 feature - * backported to WFS 1.1.0 by some Web Feature Services. Please note that some - * Web Feature Services have repurposed `maxfeatures` instead. - * @type {number|undefined} - * @api - */ -olx.format.WFSWriteGetFeatureOptions.prototype.count; - - -/** - * Extent to use for the BBOX filter. - * @type {ol.Extent|undefined} - * @api - */ -olx.format.WFSWriteGetFeatureOptions.prototype.bbox; - - -/** - * Filter condition. See {@link ol.format.filter} for more information. - * @type {ol.format.filter.Filter|undefined} - * @api - */ -olx.format.WFSWriteGetFeatureOptions.prototype.filter; - - -/** - * Indicates what response should be returned, E.g. `hits` only includes the - * `numberOfFeatures` attribute in the response and no features. - * @type {string|undefined} - * @api - */ -olx.format.WFSWriteGetFeatureOptions.prototype.resultType; - - /** * @typedef {{featureNS: string, * featurePrefix: string, diff --git a/externs/xol.js b/externs/xol.js index cd9202a500..e5bc5a0d41 100644 --- a/externs/xol.js +++ b/externs/xol.js @@ -1,28 +1,4 @@ -/** - * @typedef {Object} format_WFSWriteGetFeatureOptions - * @property {string} featureNS The namespace URI used for features. - * @property {string} featurePrefix The prefix for the feature namespace. - * @property {Array.} featureTypes The feature type names. - * @property {string|undefined} srsName SRS name. No srsName attribute will be set on geometries when this is not - * provided. - * @property {string|undefined} handle Handle. - * @property {string|undefined} outputFormat Output format. - * @property {number|undefined} maxFeatures Maximum number of features to fetch. - * @property {string|undefined} geometryName Geometry name to use in a BBOX filter. - * @property {Array.|undefined} propertyNames Optional list of property names to serialize. - * @property {number|undefined} 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|undefined} count Number of features to retrieve when paging. This is a WFS 2.0 feature - * backported to WFS 1.1.0 by some Web Feature Services. Please note that some - * Web Feature Services have repurposed `maxfeatures` instead. - * @property {ol.Extent|undefined} bbox Extent to use for the BBOX filter. - * @property {ol.format.filter.Filter|undefined} filter Filter condition. See {@link ol.format.filter} for more information. - * @property {string|undefined} resultType Indicates what response should be returned, E.g. `hits` only includes the - * `numberOfFeatures` attribute in the response and no features. - */ - - /** * @typedef {Object} format_WFSWriteTransactionOptions * @property {string} featureNS The namespace URI used for features. diff --git a/src/ol/format/WFS.js b/src/ol/format/WFS.js index 9cc0a36d11..71a98b1e01 100644 --- a/src/ol/format/WFS.js +++ b/src/ol/format/WFS.js @@ -30,6 +30,31 @@ import {createElementNS, isDocument, isNode, makeArrayPusher, makeChildAppender, */ +/** + * @typedef {Object} WriteGetFeatureOptions + * @property {string} featureNS The namespace URI used for features. + * @property {string} featurePrefix The prefix for the feature namespace. + * @property {Array.} featureTypes The feature type names. + * @property {string|undefined} srsName SRS name. No srsName attribute will be set on + * geometries when this is not provided. + * @property {string|undefined} handle Handle. + * @property {string|undefined} outputFormat Output format. + * @property {number|undefined} maxFeatures Maximum number of features to fetch. + * @property {string|undefined} geometryName Geometry name to use in a BBOX filter. + * @property {Array.|undefined} propertyNames Optional list of property names to serialize. + * @property {number|undefined} 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|undefined} count Number of features to retrieve when paging. This is a + * WFS 2.0 feature backported to WFS 1.1.0 by some Web Feature Services. Please note that some + * Web Feature Services have repurposed `maxfeatures` instead. + * @property {ol.Extent|undefined} bbox Extent to use for the BBOX filter. + * @property {ol.format.filter.Filter|undefined} filter Filter condition. See + * {@link ol.format.filter} for more information. + * @property {string|undefined} resultType Indicates what response should be returned, + * E.g. `hits` only includes the `numberOfFeatures` attribute in the response and no features. + */ + + /** * @type {string} */ @@ -890,7 +915,7 @@ function writeGetFeature(node, featureTypes, objectStack) { /** * Encode format as WFS `GetFeature` and return the Node. * - * @param {olx.format.WFSWriteGetFeatureOptions} options Options. + * @param {module:ol/format/WFS~WriteGetFeatureOptions} options Options. * @return {Node} Result. * @api */