auto-create the GetFeature readFormat for known outputFormats. r=tschaub (closes #2968)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10955 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2010-12-07 23:56:32 +00:00
parent ed7faebbcb
commit 9f47e1915d
3 changed files with 45 additions and 1 deletions
+24
View File
@@ -228,6 +228,30 @@
t.eq(features.length, 1, "the right format is used to read the request (GeoJSON)");
}
function test_outputFormat(t) {
t.plan(2);
var protocol = new OpenLayers.Protocol.WFS({
version: "1.1.0",
url: "http://some.url.org",
featureNS: "http://namespace.org",
featureType: "type",
outputFormat: 'json'
});
t.ok(protocol.readFormat instanceof OpenLayers.Format.GeoJSON, "the correct readFormat is used for outputFormat JSON");
protocol = new OpenLayers.Protocol.WFS({
version: "1.1.0",
url: "http://some.url.org",
featureNS: "http://namespace.org",
featureType: "type",
outputFormat: 'GML2'
});
t.ok(protocol.readFormat instanceof OpenLayers.Format.GML.v2, "the correct readFormat is used for outputFormat GML2");
}
function test_readOptions(t) {
t.plan(1);