From c8c8a74be7eb926191c2ad3ea63b3588482efa55 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Fri, 14 Jan 2011 16:13:10 +0000 Subject: [PATCH] In r11031 support was added for writing null geometries in an update transaction. This change corrects the syntax for null geometries, omitting the wfs:Value element altogether. r=ahocevar (closes #3010). git-svn-id: http://svn.openlayers.org/trunk/openlayers@11034 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/WFST/v1.js | 12 +++++------- tests/Format/WFST/v1.html | 1 - 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/OpenLayers/Format/WFST/v1.js b/lib/OpenLayers/Format/WFST/v1.js index cd936ae47e..c4a5b52617 100644 --- a/lib/OpenLayers/Format/WFST/v1.js +++ b/lib/OpenLayers/Format/WFST/v1.js @@ -253,8 +253,9 @@ OpenLayers.Format.WFST.v1 = OpenLayers.Class(OpenLayers.Format.XML, { // add in geometry if (this.geometryName !== null) { + this.srsName = this.getSrsName(feature); this.writeNode( - "Property", {name: this.geometryName, value: feature}, node + "Property", {name: this.geometryName, value: feature.geometry}, node ); } @@ -287,13 +288,10 @@ OpenLayers.Format.WFST.v1 = OpenLayers.Class(OpenLayers.Format.XML, { }, "Value": function(obj) { var node; - if(obj instanceof OpenLayers.Feature.Vector) { + if(obj instanceof OpenLayers.Geometry) { node = this.createElementNSPlus("wfs:Value"); - if (obj.geometry) { - this.srsName = this.getSrsName(obj); - var geom = this.writeNode("feature:_geometry", obj.geometry).firstChild; - node.appendChild(geom); - } + var geom = this.writeNode("feature:_geometry", obj).firstChild; + node.appendChild(geom); } else { node = this.createElementNSPlus("wfs:Value", {value: obj}); } diff --git a/tests/Format/WFST/v1.html b/tests/Format/WFST/v1.html index 34e8a08def..c1b590f135 100644 --- a/tests/Format/WFST/v1.html +++ b/tests/Format/WFST/v1.html @@ -262,7 +262,6 @@ the_geom - foo