Remove useless if statement on WFS writeGetFeature

Remove the if(options) {} statement as the options is not optional and
the further code expect to have this parameter.
This commit is contained in:
Benjamin Gerber
2020-11-16 06:14:25 +01:00
parent a56d9bbb51
commit 843010bfcf

View File

@@ -473,42 +473,40 @@ class WFS extends XMLFeature {
node.setAttribute('service', 'WFS'); node.setAttribute('service', 'WFS');
node.setAttribute('version', this.version_); node.setAttribute('version', this.version_);
let filter; let filter;
if (options) { if (options.handle) {
if (options.handle) { node.setAttribute('handle', options.handle);
node.setAttribute('handle', options.handle); }
} if (options.outputFormat) {
if (options.outputFormat) { node.setAttribute('outputFormat', options.outputFormat);
node.setAttribute('outputFormat', options.outputFormat); }
} if (options.maxFeatures !== undefined) {
if (options.maxFeatures !== undefined) { node.setAttribute('maxFeatures', String(options.maxFeatures));
node.setAttribute('maxFeatures', String(options.maxFeatures)); }
} if (options.resultType) {
if (options.resultType) { node.setAttribute('resultType', options.resultType);
node.setAttribute('resultType', options.resultType); }
} if (options.startIndex !== undefined) {
if (options.startIndex !== undefined) { node.setAttribute('startIndex', String(options.startIndex));
node.setAttribute('startIndex', String(options.startIndex)); }
} if (options.count !== undefined) {
if (options.count !== undefined) { node.setAttribute('count', String(options.count));
node.setAttribute('count', String(options.count)); }
} if (options.viewParams !== undefined) {
if (options.viewParams !== undefined) { node.setAttribute('viewParams', options.viewParams);
node.setAttribute('viewParams', options.viewParams); }
} filter = options.filter;
filter = options.filter; if (options.bbox) {
if (options.bbox) { assert(options.geometryName, 12); // `options.geometryName` must also be provided when `options.bbox` is set
assert(options.geometryName, 12); // `options.geometryName` must also be provided when `options.bbox` is set const bbox = bboxFilter(
const bbox = bboxFilter( /** @type {string} */ (options.geometryName),
/** @type {string} */ (options.geometryName), options.bbox,
options.bbox, options.srsName
options.srsName );
); if (filter) {
if (filter) { // if bbox and filter are both set, combine the two into a single filter
// if bbox and filter are both set, combine the two into a single filter filter = andFilter(filter, bbox);
filter = andFilter(filter, bbox); } else {
} else { filter = bbox;
filter = bbox;
}
} }
} }
node.setAttributeNS( node.setAttributeNS(