Skip to content

Commit

Permalink
Make sure WFS format writing works correctly in IE9+
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart van den Eijnden committed Jun 4, 2014
1 parent 38d8799 commit 87ea5fa
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/ol/format/wfsformat.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ goog.inherits(ol.format.WFS, ol.format.XMLFeature);
ol.format.WFS.featurePrefix = 'feature';


/**
* @const
* @type {string}
*/
ol.format.WFS.xmlns = 'http://www.w3.org/2000/xmlns/';


/**
* @typedef {{numberOfFeatures: number,
* bounds: ol.Extent}}
Expand Down Expand Up @@ -377,7 +384,8 @@ ol.format.WFS.writeDelete_ = function(node, feature, objectStack) {
ol.format.WFS.featurePrefix;
var featureNS = goog.object.get(context, 'featureNS');
node.setAttribute('typeName', featurePrefix + ':' + featureType);
node.setAttribute('xmlns:' + featurePrefix, featureNS);
ol.xml.setAttributeNS(node, ol.format.WFS.xmlns, 'xmlns:' + featurePrefix,
featureNS);
var fid = feature.getId();
if (goog.isDef(fid)) {
ol.format.WFS.writeOgcFidFilter_(node, fid, objectStack);
Expand All @@ -400,7 +408,8 @@ ol.format.WFS.writeUpdate_ = function(node, feature, objectStack) {
ol.format.WFS.featurePrefix;
var featureNS = goog.object.get(context, 'featureNS');
node.setAttribute('typeName', featurePrefix + ':' + featureType);
node.setAttribute('xmlns:' + featurePrefix, featureNS);
ol.xml.setAttributeNS(node, ol.format.WFS.xmlns, 'xmlns:' + featurePrefix,
featureNS);
var fid = feature.getId();
if (goog.isDef(fid)) {
var keys = feature.getKeys();
Expand Down Expand Up @@ -497,7 +506,8 @@ ol.format.WFS.writeQuery_ = function(node, featureType, objectStack) {
node.setAttribute('srsName', srsName);
}
if (goog.isDef(featureNS)) {
node.setAttribute('xmlns:' + featurePrefix, featureNS);
ol.xml.setAttributeNS(node, ol.format.WFS.xmlns, 'xmlns:' + featurePrefix,
featureNS);
}
var item = goog.object.clone(context);
item.node = node;
Expand Down

0 comments on commit 87ea5fa

Please sign in to comment.