add infoFormats to WMSCapabilities Format, r=ahocevar (closes #3539)

This commit is contained in:
Bart van den Eijnden
2011-10-10 08:24:24 +02:00
parent 760d5a584c
commit 64f111a308
3 changed files with 7 additions and 3 deletions

View File

@@ -112,6 +112,9 @@ OpenLayers.Format.WMSCapabilities.v1 = OpenLayers.Class(
if (layer.formats === undefined) {
layer.formats = capability.request.getmap.formats;
}
if (layer.infoFormats === undefined && capability.request.getfeatureinfo) {
layer.infoFormats = capability.request.getfeatureinfo.formats;
}
var i, len;

View File

@@ -14,7 +14,7 @@
function test_read(t) {
t.plan(23);
t.plan(24);
var xml = document.getElementById("gssample").firstChild.nodeValue;
var doc = new OpenLayers.Format.XML().read(xml);
@@ -80,6 +80,7 @@
t.eq(capability.layers.length, 22, "correct number of layers parsed");
var layer = capability.layers[2];
t.eq(layer.infoFormats, ["text/plain", "text/html", "application/vnd.ogc.gml"], "infoFormats set on layer");
t.eq(layer.name, "tiger:tiger_roads", "[2] correct layer name");
t.eq(layer.prefix, "tiger", "[2] correct layer prefix");
t.eq(layer.title, "Manhattan (NY) roads", "[2] correct layer title");

View File

@@ -14,7 +14,7 @@
function test_layers(t) {
t.plan(24);
t.plan(25);
var xml = document.getElementById("ogcsample").firstChild.nodeValue;
var doc = new OpenLayers.Format.XML().read(xml);
@@ -40,7 +40,7 @@
t.eq(layers["Temperature"].srs,
{"CRS:84": true},
"Inheritance of SRS handled correctly when redeclaring an inherited SRS");
t.eq(layers["Temperature"].infoFormats, ["text/xml", "text/plain", "text/html"], "infoFormats set correctly on layer");
var bbox = layers["ROADS_RIVERS"].bbox["EPSG:26986"];
t.eq(bbox.bbox,
[189000, 834000, 285000, 962000],