From 61b291ee67591cf8803355135d19cbdd37890869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Mon, 8 Aug 2011 04:45:41 +0000 Subject: [PATCH] WMSCapabilities format may fail to correctly read BoundingBox of layers, r=fredj (closes #3449) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12209 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/WMSCapabilities/v1.js | 8 ++++---- tests/Format/WMSCapabilities/v1_1_1.html | 11 ++++++++--- tests/Format/WMSCapabilities/v1_3_0.html | 9 ++++++++- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lib/OpenLayers/Format/WMSCapabilities/v1.js b/lib/OpenLayers/Format/WMSCapabilities/v1.js index 2fb49e9c49..596d19d6ab 100644 --- a/lib/OpenLayers/Format/WMSCapabilities/v1.js +++ b/lib/OpenLayers/Format/WMSCapabilities/v1.js @@ -133,8 +133,8 @@ OpenLayers.Format.WMSCapabilities.v1 = OpenLayers.Class( "dimensions", "authorityURLs"]; - var key; - for (var j=0; j - + ROADS_RIVERS diff --git a/tests/Format/WMSCapabilities/v1_3_0.html b/tests/Format/WMSCapabilities/v1_3_0.html index 334264f171..9d7eecdac5 100644 --- a/tests/Format/WMSCapabilities/v1_3_0.html +++ b/tests/Format/WMSCapabilities/v1_3_0.html @@ -14,7 +14,7 @@ function test_layers(t) { - t.plan(22); + t.plan(24); var xml = document.getElementById("ogcsample").firstChild.nodeValue; var doc = new OpenLayers.Format.XML().read(xml); @@ -46,6 +46,11 @@ [189000, 834000, 285000, 962000], "Correct bbox from BoundingBox"); t.eq(bbox.res, {x: 1, y: 1}, "Correct resolution"); + bbox = layers["ROADS_RIVERS"].bbox["CRS:84"]; + t.eq(bbox.bbox, + [-71.63, 41.75, -70.78, 42.90], + "Correct bbox from BoundingBox (override)"); + t.eq(bbox.res, {x: 0.01, y: 0.01}, "Correct resolution (override)"); bbox = layers["ROADS_1M"].bbox["EPSG:26986"]; t.eq(bbox.bbox, @@ -432,6 +437,8 @@ Changes: + ROADS_RIVERS