Make sure ol.format.GML2 is usable for WFS 1.0 requests as well

This commit is contained in:
Bart van den Eijnden
2015-04-22 19:43:49 +02:00
parent 46e780d1ca
commit c74293335c
4 changed files with 106 additions and 3 deletions

View File

@@ -27,6 +27,10 @@ ol.format.GML2 = function(opt_options) {
goog.base(this, options);
this.FEATURE_COLLECTION_PARSERS[ol.format.GMLBase.GMLNS][
'featureMember'] =
ol.xml.makeArrayPusher(ol.format.GMLBase.prototype.readFeaturesInternal);
/**
* @inheritDoc
*/

View File

@@ -101,9 +101,15 @@ ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
var localName = ol.xml.getLocalName(node);
var features;
if (localName == 'FeatureCollection') {
features = ol.xml.pushParseAndPop(null,
this.FEATURE_COLLECTION_PARSERS, node,
objectStack, this);
if (node.namespaceURI === 'http://www.opengis.net/wfs') {
features = ol.xml.pushParseAndPop([],
this.FEATURE_COLLECTION_PARSERS, node,
objectStack, this);
} else {
features = ol.xml.pushParseAndPop(null,
this.FEATURE_COLLECTION_PARSERS, node,
objectStack, this);
}
} else if (localName == 'featureMembers' || localName == 'featureMember') {
var context = objectStack[0];
goog.asserts.assert(goog.isObject(context), 'context should be an Object');