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

View File

@@ -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});
}