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:
@@ -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});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user