[OpenLayers-Commits] r11034 - in trunk/openlayers: lib/OpenLayers/Format/WFST tests/Format/WFST

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Fri Jan 14 11:13:10 EST 2011


Author: tschaub
Date: 2011-01-14 08:13:10 -0800 (Fri, 14 Jan 2011)
New Revision: 11034

Modified:
   trunk/openlayers/lib/OpenLayers/Format/WFST/v1.js
   trunk/openlayers/tests/Format/WFST/v1.html
Log:
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).

Modified: trunk/openlayers/lib/OpenLayers/Format/WFST/v1.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Format/WFST/v1.js	2011-01-14 15:56:07 UTC (rev 11033)
+++ trunk/openlayers/lib/OpenLayers/Format/WFST/v1.js	2011-01-14 16:13:10 UTC (rev 11034)
@@ -253,8 +253,9 @@
                 
                 // 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 @@
             },
             "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});                
                 }

Modified: trunk/openlayers/tests/Format/WFST/v1.html
===================================================================
--- trunk/openlayers/tests/Format/WFST/v1.html	2011-01-14 15:56:07 UTC (rev 11033)
+++ trunk/openlayers/tests/Format/WFST/v1.html	2011-01-14 16:13:10 UTC (rev 11034)
@@ -262,7 +262,6 @@
 <wfs:Update xmlns:wfs="http://www.opengis.net/wfs" typeName="topp:states" xmlns:topp="http://www.openplans.org/topp">
     <wfs:Property>
         <wfs:Name>the_geom</wfs:Name>
-        <wfs:Value></wfs:Value>
     </wfs:Property>
     <wfs:Property>
         <wfs:Name>foo</wfs:Name>



More information about the Commits mailing list