[OpenLayers-Commits] r12209 - in trunk/openlayers: lib/OpenLayers/Format/WMSCapabilities tests/Format/WMSCapabilities

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Mon Aug 8 00:45:42 EDT 2011


Author: erilem
Date: 2011-08-07 21:45:41 -0700 (Sun, 07 Aug 2011)
New Revision: 12209

Modified:
   trunk/openlayers/lib/OpenLayers/Format/WMSCapabilities/v1.js
   trunk/openlayers/tests/Format/WMSCapabilities/v1_1_1.html
   trunk/openlayers/tests/Format/WMSCapabilities/v1_3_0.html
Log:
WMSCapabilities format may fail to correctly read BoundingBox of layers, r=fredj (closes #3449)

Modified: trunk/openlayers/lib/OpenLayers/Format/WMSCapabilities/v1.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Format/WMSCapabilities/v1.js	2011-08-05 07:58:57 UTC (rev 12208)
+++ trunk/openlayers/lib/OpenLayers/Format/WMSCapabilities/v1.js	2011-08-08 04:45:41 UTC (rev 12209)
@@ -133,8 +133,8 @@
                                "dimensions",
                                "authorityURLs"];
             
-            var key;
-            for (var j=0; j<attributes.length; j++) {
+            var key, j;
+            for (j=0; j<attributes.length; j++) {
                 key = attributes[j];
                 if (key in parentLayer) {
                     // only take parent value if not present (null or undefined)
@@ -157,9 +157,9 @@
                 }
             }
 
-            for (var j=0; j<complexAttr.length; j++) {
+            for (j=0; j<complexAttr.length; j++) {
                 key = complexAttr[j];
-                layer[key] = OpenLayers.Util.extend(
+                layer[key] = OpenLayers.Util.applyDefaults(
                     layer[key], parentLayer[key]);
             }
         }

Modified: trunk/openlayers/tests/Format/WMSCapabilities/v1_1_1.html
===================================================================
--- trunk/openlayers/tests/Format/WMSCapabilities/v1_1_1.html	2011-08-05 07:58:57 UTC (rev 12208)
+++ trunk/openlayers/tests/Format/WMSCapabilities/v1_1_1.html	2011-08-08 04:45:41 UTC (rev 12209)
@@ -111,7 +111,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);
@@ -143,7 +143,11 @@
              [189000, 834000, 285000, 962000],
              "Correct bbox from BoundingBox");
         t.eq(bbox.res, {x: 1, y: 1}, "Correct resolution");
-
+        bbox = layers["ROADS_RIVERS"].bbox["EPSG:4326"];
+        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,
              [189000, 834000, 285000, 962000],
@@ -535,8 +539,9 @@
       <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"
        xlink:href="http://gcmd.gsfc.nasa.gov/difguide/whatisadif.html" />
     </AuthorityURL>
+    <BoundingBox SRS="EPSG:4326"
+     minx="-1" miny="-1" maxx="1" maxy="1" resx="0.0" resy="0.0"/>
 
-
     <Layer>
       <Name>ROADS_RIVERS</Name> 
       <Title>Roads and Rivers</Title>

Modified: trunk/openlayers/tests/Format/WMSCapabilities/v1_3_0.html
===================================================================
--- trunk/openlayers/tests/Format/WMSCapabilities/v1_3_0.html	2011-08-05 07:58:57 UTC (rev 12208)
+++ trunk/openlayers/tests/Format/WMSCapabilities/v1_3_0.html	2011-08-08 04:45:41 UTC (rev 12209)
@@ -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 @@
       <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"
        xlink:href="http://gcmd.gsfc.nasa.gov/difguide/whatisadif.html" />
     </AuthorityURL>
+    <BoundingBox CRS="CRS:84"
+     minx="-1" miny="-1" maxx="1" maxy="1" resx="0.0" resy="0.0"/>
     <Layer>
 
       <Name>ROADS_RIVERS</Name>



More information about the Commits mailing list