OpenLayers.Protocol.WFS misses a setGeometryName method, p=fvanderbiest, r=me,erilem (closes #3037)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11670 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -195,6 +195,18 @@ OpenLayers.Protocol.WFS.v1 = OpenLayers.Class(OpenLayers.Protocol, {
|
|||||||
this.featureType = featureType;
|
this.featureType = featureType;
|
||||||
this.format.featureType = featureType;
|
this.format.featureType = featureType;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APIMethod: setGeometryName
|
||||||
|
* Sets the geometryName option after instantiation.
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
|
* geometryName - {String} Name of geometry attribute.
|
||||||
|
*/
|
||||||
|
setGeometryName: function(geometryName) {
|
||||||
|
this.geometryName = geometryName;
|
||||||
|
this.format.geometryName = geometryName;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method: handleRead
|
* Method: handleRead
|
||||||
|
|||||||
@@ -24,6 +24,23 @@
|
|||||||
"initialize returns instance of custom versioned protocol")
|
"initialize returns instance of custom versioned protocol")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_setGeometryName(t) {
|
||||||
|
t.plan(4);
|
||||||
|
var protocol = new OpenLayers.Protocol.WFS({
|
||||||
|
url: "http://some.url.org",
|
||||||
|
featureNS: "http://namespace.org",
|
||||||
|
featureType: "type",
|
||||||
|
geometryName: "geom"
|
||||||
|
});
|
||||||
|
t.eq(protocol.geometryName, "geom", "geometryName set correctly by constructor");
|
||||||
|
t.eq(protocol.format.geometryName, "geom", "geometryName correctly set on format by constructor");
|
||||||
|
// change the geometryName on the fly
|
||||||
|
protocol.setGeometryName("SHAPE");
|
||||||
|
t.eq(protocol.geometryName, "SHAPE", "geometryName changed correctly by setGeometryName");
|
||||||
|
t.eq(protocol.format.geometryName, "SHAPE", "geometryName correctly changed on format by setGeometryName");
|
||||||
|
protocol.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
function test_setFeatureType(t) {
|
function test_setFeatureType(t) {
|
||||||
t.plan(4);
|
t.plan(4);
|
||||||
var protocol = new OpenLayers.Protocol.WFS({
|
var protocol = new OpenLayers.Protocol.WFS({
|
||||||
|
|||||||
Reference in New Issue
Block a user