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
This commit is contained in:
Tim Schaub
2011-01-14 16:13:10 +00:00
parent 441a5408cd
commit c8c8a74be7
2 changed files with 5 additions and 8 deletions
+5 -7
View File
@@ -253,8 +253,9 @@ OpenLayers.Format.WFST.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
// add in geometry // add in geometry
if (this.geometryName !== null) { if (this.geometryName !== null) {
this.srsName = this.getSrsName(feature);
this.writeNode( 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) { "Value": function(obj) {
var node; var node;
if(obj instanceof OpenLayers.Feature.Vector) { if(obj instanceof OpenLayers.Geometry) {
node = this.createElementNSPlus("wfs:Value"); node = this.createElementNSPlus("wfs:Value");
if (obj.geometry) { var geom = this.writeNode("feature:_geometry", obj).firstChild;
this.srsName = this.getSrsName(obj); node.appendChild(geom);
var geom = this.writeNode("feature:_geometry", obj.geometry).firstChild;
node.appendChild(geom);
}
} else { } else {
node = this.createElementNSPlus("wfs:Value", {value: obj}); node = this.createElementNSPlus("wfs:Value", {value: obj});
} }
-1
View File
@@ -262,7 +262,6 @@
<wfs:Update xmlns:wfs="http://www.opengis.net/wfs" typeName="topp:states" xmlns:topp="http://www.openplans.org/topp"> <wfs:Update xmlns:wfs="http://www.opengis.net/wfs" typeName="topp:states" xmlns:topp="http://www.openplans.org/topp">
<wfs:Property> <wfs:Property>
<wfs:Name>the_geom</wfs:Name> <wfs:Name>the_geom</wfs:Name>
<wfs:Value></wfs:Value>
</wfs:Property> </wfs:Property>
<wfs:Property> <wfs:Property>
<wfs:Name>foo</wfs:Name> <wfs:Name>foo</wfs:Name>