Add gmlFormat as option for WFS format

This commit is contained in:
Florent gravin
2014-09-23 14:51:13 +02:00
parent 192c7827c9
commit f8e8653480
3 changed files with 16 additions and 2 deletions

View File

@@ -30,7 +30,7 @@ goog.inherits(ol.format.GML.v2, ol.format.GML);
/**
* @protected
* @private
* @type {string}
*/
ol.format.GML.v2.schemaLocation_ = 'http://www.opengis.net/gml ' +

View File

@@ -40,6 +40,13 @@ ol.format.WFS = function(opt_options) {
*/
this.featureNS_ = options.featureNS;
/**
* @private
* @type {string}
*/
this.gmlFormat_ = goog.isDef(options.gmlFormat) ?
options.gmlFormat : new ol.format.GML();
/**
* @private
* @type {string}
@@ -119,7 +126,8 @@ ol.format.WFS.prototype.readFeaturesFromNode = function(node, opt_options) {
goog.isDef(opt_options) ? opt_options : {}));
var objectStack = [context];
var features = ol.xml.pushParseAndPop([],
ol.format.GML.FEATURE_COLLECTION_PARSERS, node, objectStack);
ol.format.GML.FEATURE_COLLECTION_PARSERS, node,
objectStack, this.gmlFormat_);
if (!goog.isDef(features)) {
features = [];
}