GetFeatureInfo requests should take EXCEPTIONS parameter from the WMS layer

This commit is contained in:
Bart van den Eijnden
2012-03-05 09:56:31 +01:00
parent cf9cc27279
commit 6204fe50c6
2 changed files with 4 additions and 1 deletions
@@ -341,6 +341,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
service: "WMS", service: "WMS",
version: firstLayer.params.VERSION, version: firstLayer.params.VERSION,
request: "GetFeatureInfo", request: "GetFeatureInfo",
exceptions: firstLayer.params.EXCEPTIONS,
bbox: this.map.getExtent().toBBOX(null, bbox: this.map.getExtent().toBBOX(null,
firstLayer.reverseAxisOrder()), firstLayer.reverseAxisOrder()),
feature_count: this.maxFeatures, feature_count: this.maxFeatures,
+3 -1
View File
@@ -476,7 +476,7 @@
} }
function test_drillDown(t) { function test_drillDown(t) {
t.plan(6); t.plan(7);
var map = new OpenLayers.Map("map", { var map = new OpenLayers.Map("map", {
getExtent: function() {return(new OpenLayers.Bounds(-180,-90,180,90));} getExtent: function() {return(new OpenLayers.Bounds(-180,-90,180,90));}
} }
@@ -493,6 +493,7 @@
// this service does not support application/vnd.ogc.gml for GetFeatureInfo, only text/xml // this service does not support application/vnd.ogc.gml for GetFeatureInfo, only text/xml
var c = new OpenLayers.Layer.WMS("dummy","http://myhost/wms", { var c = new OpenLayers.Layer.WMS("dummy","http://myhost/wms", {
layers: "x", layers: "x",
exceptions: "text/xml",
info_format: "text/xml" info_format: "text/xml"
}); });
@@ -515,6 +516,7 @@
t.eq(options.url, "http://localhost/wms", "Correct url used for second request"); t.eq(options.url, "http://localhost/wms", "Correct url used for second request");
} else if (count == 1) { } else if (count == 1) {
t.eq(options.params["INFO_FORMAT"], "text/xml", "Overridden info format is used instead of the control's infoFormat"); t.eq(options.params["INFO_FORMAT"], "text/xml", "Overridden info format is used instead of the control's infoFormat");
t.eq(options.params["EXCEPTIONS"], "text/xml", "Exceptions parameter is used from the WMS layer");
t.eq(options.url, "http://myhost/wms", "Correct url used for first request"); t.eq(options.url, "http://myhost/wms", "Correct url used for first request");
} }
}; };