Merge pull request #1346 from ahocevar/set-srsname

Set the srs name when writing GetFeature
This commit is contained in:
ahocevar
2013-12-09 08:28:14 -08:00
3 changed files with 8 additions and 3 deletions

View File

@@ -600,8 +600,9 @@
* @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 {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.

View File

@@ -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}));
}
};

View File

@@ -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];