diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc index c2c035b8cb..e9c0fe5c09 100644 --- a/src/objectliterals.jsdoc +++ b/src/objectliterals.jsdoc @@ -600,8 +600,9 @@ * @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} srsName SRS name. For WFS 1.1.0, this is + * required. In WFS 1.0.0, 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} maxFeatures Maximum number of features to fetch. diff --git a/src/ol/parser/ogc/filterparser_v1.js b/src/ol/parser/ogc/filterparser_v1.js index 6a5822ee4f..3d3ff44d55 100644 --- a/src/ol/parser/ogc/filterparser_v1.js +++ b/src/ol/parser/ogc/filterparser_v1.js @@ -648,6 +648,7 @@ ol.parser.ogc.Filter_v1.prototype.setFeatureType = function(featureType) { ol.parser.ogc.Filter_v1.prototype.setSrsName = function(srsName) { this.srsName = srsName; if (goog.isDefAndNotNull(this.gmlParser_)) { - this.gmlParser_.srsName = this.srsName; + this.gmlParser_.applyWriteOptions({}, + /** @type {ol.parser.GMLWriteOptions} */ ({srsName: srsName})); } }; diff --git a/src/ol/parser/ogc/wfsparser_v1.js b/src/ol/parser/ogc/wfsparser_v1.js index 0f188f9074..002fc9a9ab 100644 --- a/src/ol/parser/ogc/wfsparser_v1.js +++ b/src/ol/parser/ogc/wfsparser_v1.js @@ -47,6 +47,9 @@ ol.parser.ogc.WFS_v1 = function(opt_options) { if (goog.isDef(options.maxFeatures)) { node.setAttribute('maxFeatures', options.maxFeatures); } + if (goog.isDef(options.srsName)) { + this.setSrsName(options.srsName); + } } for (var i = 0, ii = options.featureTypes.length; i < ii; i++) { options.featureType = options.featureTypes[i];