Layer.WMS should use a supported exception format for WMS 1.3 by default, p=ahocevar, r=me (closes #2478)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10648 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
bartvde
2010-08-20 18:48:55 +00:00
parent 7eaa37856c
commit 050eda6670
2 changed files with 9 additions and 3 deletions

View File

@@ -95,6 +95,9 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
var newArguments = [];
//uppercase params
params = OpenLayers.Util.upperCaseObject(params);
if (parseFloat(params.VERSION) >= 1.3 && !params.EXCEPTIONS) {
params.EXCEPTIONS = "INIMAGE";
}
newArguments.push(name, url, params, options);
OpenLayers.Layer.Grid.prototype.initialize.apply(this, newArguments);
OpenLayers.Util.applyDefaults(

View File

@@ -400,7 +400,7 @@
function test_Layer_WMS_v13(t) {
t.plan(5);
t.plan(6);
var lon = 5;
var lat = 40;
@@ -468,16 +468,19 @@
var url = layer.getURL(map.getExtent());
var params = url.split("&");
var bbox;
var bbox, exceptions;
for (var i=0, len=params.length; i<len; i++) {
var param = params[i];
var a = param.split('=');
if (a[0] === 'EXCEPTIONS') {
exceptions = a[1];
}
if (a[0] === 'BBOX') {
bbox = a[1];
break;
}
}
t.eq(exceptions, "INIMAGE", "If not set, EXCEPTIONS should be INIMAGE for WMS 1.3");
t.eq(bbox, "-5.986328125,27.9150390625,15.986328125,52.0849609375", "Axis sequence for CRS:84 is lon lat");
map.destroy();