[Commits] r319 - apps/opengeo/geoexplorer/trunk/lib

commits at geoext.org commits at geoext.org
Wed Apr 1 21:52:50 CEST 2009


Author: sbenthall
Date: 2009-04-01 21:52:49 +0200 (Wed, 01 Apr 2009)
New Revision: 319

Modified:
   apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
Log:
tightened up extractConfiguration method


Modified: apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js	2009-04-01 19:29:17 UTC (rev 318)
+++ apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js	2009-04-01 19:52:49 UTC (rev 319)
@@ -330,20 +330,16 @@
         config.ows = this.ows;
 
         // Map configuration
-        var mapConfig = {}
 
-        mapConfig.zoom = this.map.zoom;
-
         var center = this.map.getCenter();
-        mapConfig.center = [center.lon, center.lat];
+        
+        config.map = {
+            center: [center.lon, center.lat],
+            zoom: this.map.zoom
+        }
 
-        config.map = mapConfig;
-        //End Map configuration
-
-
-
         //Layers configuration
-        var layerConfig = [];
+        config.map.layers = [];
 
         this.layers.each(function(layerRecord){
             //if it's the dummy layer, do nothing.
@@ -351,26 +347,21 @@
                 return;
             }
 
-
             var c = {
                 title: layerRecord.get("title"),
                 name: (layerRecord.get("layer").params 
                        && layerRecord.get("layer").params.LAYERS)
                     || layerRecord.get("name")
             };
-            
+
+            //TODO: This isn't quite right.
             if (layerRecord.get("queryable")) {
                 c.queryable = layerRecord.get("queryable");
             }
 
-            layerConfig.push(c);
+            config.map.layers.push(c);
         });
 
-
-        config.map.layers = layerConfig
-        //End Layers configuration
-
-
         return config;
     }
 });



More information about the Commits mailing list