diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc index 1de0782977..d416c8b63e 100644 --- a/src/objectliterals.jsdoc +++ b/src/objectliterals.jsdoc @@ -595,20 +595,6 @@ * calculations. */ -/** - * @typedef {Object} ol.parser.WFSOptions - * @property {string} featureNS The feature namespace to use. - * @property {string} featurePrefix The prefix for the namespace. - * @property {Array.} featureTypes The feature types to use. - */ - -/** - * @typedef {Object} ol.parser.WFSNative - * @property {string} vendorId The vendor id to use. - * @property {boolean} safeToIgnore Is it safe to ignore? - * @property {string} value The value of the Native element. - */ - /** * @typedef {Object} ol.source.BingMapsOptions * @property {string|undefined} culture Culture code. Default is `en-us`. diff --git a/src/ol/parser/ogc/wfsparser_v1.js b/src/ol/parser/ogc/wfsparser_v1.js index fff9f4fba2..892e7a851f 100644 --- a/src/ol/parser/ogc/wfsparser_v1.js +++ b/src/ol/parser/ogc/wfsparser_v1.js @@ -3,6 +3,22 @@ goog.require('goog.dom.xml'); goog.require('ol.parser.XML'); +/** + * @typedef {{featureNS: string, + featurePrefix: string, + featureTypes: Array., + handle: string, + outputFormat: string, + nativeElements: Array.<{ + vendorId: string, + safeToIgnore: boolean, + value: string + }>, + maxFeatures: number}} + */ +ol.parser.WFSWriteOptions; + + /** * @constructor @@ -21,7 +37,7 @@ ol.parser.ogc.WFS_v1 = function() { this.writers = {}; this.writers[this.defaultNamespaceURI] = { 'GetFeature': function(options) { - options = /** @type {ol.parser.WFSOptions} */(options); + options = /** @type {ol.parser.WFSWriteOptions} */(options); var node = this.createElementNS('wfs:GetFeature'); node.setAttribute('service', 'WFS'); node.setAttribute('version', this.version); @@ -47,7 +63,7 @@ ol.parser.ogc.WFS_v1 = function() { }, 'Transaction': function(obj) { obj = obj || {}; - var options = obj.options || {}; + var options = /** {ol.parser.WFSWriteOptions} */(obj.options || {}); var node = this.createElementNS('wfs:Transaction'); node.setAttribute('service', 'WFS'); node.setAttribute('version', this.version); @@ -152,7 +168,7 @@ ol.parser.ogc.WFS_v1.prototype.read = function(data) { /** * @param {Array.} features The features to write out. - * @param {Object} options Write options. + * @param {ol.parser.WFSWriteOptions} options Write options. * @return {string} A serialized WFS transaction. */ ol.parser.ogc.WFS_v1.prototype.write = function(features, options) { diff --git a/test/spec/ol/parser/ogc/wfs_v1.test.js b/test/spec/ol/parser/ogc/wfs_v1.test.js index a64b00b203..22bf07fc01 100644 --- a/test/spec/ol/parser/ogc/wfs_v1.test.js +++ b/test/spec/ol/parser/ogc/wfs_v1.test.js @@ -52,17 +52,15 @@ describe('ol.parser.ogc.WFS', function() { var url = 'spec/ol/parser/ogc/xml/wfs_v1/Native.xml'; afterLoadXml(url, function(xml) { var p = new ol.parser.ogc.WFS_v1_1_0(); - var output = p.write(null, { - nativeElements: [{ - vendorId: 'ORACLE', - safeToIgnore: true, - value: 'ALTER SESSION ENABLE PARALLEL DML' - }, { - vendorId: 'ORACLE', - safeToIgnore: false, - value: 'Another native line goes here' - }] - }); + var output = p.write(null, {nativeElements: [{ + vendorId: 'ORACLE', + safeToIgnore: true, + value: 'ALTER SESSION ENABLE PARALLEL DML' + }, { + vendorId: 'ORACLE', + safeToIgnore: false, + value: 'Another native line goes here' + }]}); expect(goog.dom.xml.loadXml(output)).to.xmleql(xml); done(); });