don't use null geometryName for WFS versions < 1.1. r=elemoine (closes #3415)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@12216 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2011-08-08 13:22:59 +00:00
parent c518df57e7
commit 51efcde523
3 changed files with 13 additions and 11 deletions

View File

@@ -43,7 +43,7 @@ OpenLayers.Protocol.WFS.v1 = OpenLayers.Class(OpenLayers.Protocol, {
/**
* Property: geometryName
* {String} Name of the geometry attribute for features. Default is
* "the_geom".
* "the_geom" for WFS <version> 1.0, and null for higher versions.
*/
geometryName: "the_geom",
@@ -102,19 +102,16 @@ OpenLayers.Protocol.WFS.v1 = OpenLayers.Class(OpenLayers.Protocol, {
* for this featureType).
* featurePrefix - {String} Feature namespace alias (optional - only used
* for writing if featureNS is provided). Default is 'feature'.
* geometryName - {String} Name of geometry attribute. If featureNS is not
* configured, the default is null to avoid failing on BBOX filters,
* and it will be set on <read>. Otherwise, the default is 'the_geom'.
* geometryName - {String} Name of geometry attribute. The default is
* 'the_geom' for WFS <version> 1.0, and null for higher versions. If
* null, it will be set to the name of the first geometry found in the
* first read operation.
* multi - {Boolean} If set to true, geometries will be casted to Multi
* geometries before they are written in a transaction. No casting will
* be done when reading features.
*/
initialize: function(options) {
OpenLayers.Protocol.prototype.initialize.apply(this, [options]);
if (!options.geometryName && !options.featureNS) {
// poorly configured protocol - try to not fail on BBOX filters
this.geometryName = null;
}
if(!options.format) {
this.format = OpenLayers.Format.WFST(OpenLayers.Util.extend({
version: this.version,
@@ -126,6 +123,9 @@ OpenLayers.Protocol.WFS.v1 = OpenLayers.Class(OpenLayers.Protocol, {
schema: this.schema
}, this.formatOptions));
}
if (!options.geometryName && parseFloat(this.format.version) > 1.0) {
this.setGeometryName(null);
}
},
/**