[Commits] r1336 - in sandbox/camptocamp/geobretagne: lib/GeoExt/data tests/lib/GeoExt/data

commits at geoext.org commits at geoext.org
Mon Aug 24 13:25:46 CEST 2009


Author: elemoine
Date: 2009-08-24 13:25:46 +0200 (Mon, 24 Aug 2009)
New Revision: 1336

Modified:
   sandbox/camptocamp/geobretagne/lib/GeoExt/data/WMSCapabilitiesReader.js
   sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/WMSCapabilitiesReader.html
Log:
applying patch_152-r1335-A1.diff from #152.


Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/data/WMSCapabilitiesReader.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/data/WMSCapabilitiesReader.js	2009-08-24 11:13:46 UTC (rev 1335)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/data/WMSCapabilitiesReader.js	2009-08-24 11:25:46 UTC (rev 1336)
@@ -160,6 +160,18 @@
         for(var i=0, len=capability.layers.length; i<len; i++){
             layer = capability.layers[i];
             if(layer.name) {
+                var options = {
+                    minScale: layer.minScale != undefined ? 
+                        layer.minScale : undefined,
+                    maxScale: layer.maxScale != undefined ? 
+                        layer.maxScale : undefined,
+                    attribution: layer.attribution ?
+                        this.attributionMarkup(layer.attribution) :
+                        undefined
+                };
+                if(this.meta.layerOptions) {
+                    Ext.apply(options, this.meta.layerOptions);
+                }
                 var l = new OpenLayers.Layer.WMS(
                     layer.title || layer.name,
                     url, {
@@ -170,15 +182,8 @@
                         format: this.imageFormat(layer),
                         transparent: this.imageTransparent(layer),
                         version: data.version
-                    }, {
-                        minScale: layer.minScale != undefined ? 
-                            layer.minScale : undefined,
-                        maxScale: layer.maxScale != undefined ? 
-                            layer.maxScale : undefined,
-                        attribution: layer.attribution ?
-                            this.attributionMarkup(layer.attribution) :
-                            undefined
-                    }
+                    },
+                    options
                 );
                 records.push(new this.recordType(Ext.apply(layer, {
                     layer: l

Modified: sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/WMSCapabilitiesReader.html
===================================================================
--- sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/WMSCapabilitiesReader.html	2009-08-24 11:13:46 UTC (rev 1335)
+++ sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/WMSCapabilitiesReader.html	2009-08-24 11:25:46 UTC (rev 1336)
@@ -33,9 +33,13 @@
                  'field values set from configuration are correct');
         }
         function test_read(t) {
-            t.plan(35);
+            t.plan(36);
 
-            var reader = new GeoExt.data.WMSCapabilitiesReader();
+            var reader = new GeoExt.data.WMSCapabilitiesReader({
+                layerOptions: {
+                    singleTile: true
+                }
+            });
 
             var records = reader.read({responseXML: doc});
 
@@ -90,7 +94,7 @@
             t.eq(record.get("identifiers").gcmd, "id_value", "[2] correct identifiers attribute");
             // cannot test "dimensions" until we have nested layers: see http://trac.openlayers.org/ticket/2144
 
-            //6 tests -- Testing the layer field
+            //7 tests -- Testing the layer field
             record = records.records[2];
             layer = record.get("layer");
             t.eq(layer.CLASS_NAME, "OpenLayers.Layer.WMS", "[2] layer field is of type OpenLayers.Layer.WMS");
@@ -99,6 +103,7 @@
             t.eq(layer.name, "Manhattan (NY) roads","[2] layer field has correct name");
             t.eq(typeof(layer.minScale), "number","[2] layer minScale has been set");
             t.eq(typeof(layer.maxScale), "number","[2] layer maxScale has been set");
+            t.eq(layer.singleTile, true, "[2] layer field has correct singleTile attribute (from WMSCapabilitiesReader constructor)");
             
             // 3 tests -- attribution markup
             record = records.records[2];



More information about the Commits mailing list