[Commits] r1199 - in apps/opengeo/geoexplorer/trunk: build src/script/app

commits at geoext.org commits at geoext.org
Wed Jul 1 22:59:51 CEST 2009


Author: tschaub
Date: 2009-07-01 22:59:51 +0200 (Wed, 01 Jul 2009)
New Revision: 1199

Modified:
   apps/opengeo/geoexplorer/trunk/build/license.js
   apps/opengeo/geoexplorer/trunk/src/script/app/GeoExplorer.js
Log:
Persist custom title in bookmark.

Modified: apps/opengeo/geoexplorer/trunk/build/license.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/build/license.js	2009-07-01 18:22:24 UTC (rev 1198)
+++ apps/opengeo/geoexplorer/trunk/build/license.js	2009-07-01 20:59:51 UTC (rev 1199)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2008-2009, The Open Planning Project
+Copyright (c) 2008-2009, OpenGeo
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without

Modified: apps/opengeo/geoexplorer/trunk/src/script/app/GeoExplorer.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/src/script/app/GeoExplorer.js	2009-07-01 18:22:24 UTC (rev 1198)
+++ apps/opengeo/geoexplorer/trunk/src/script/app/GeoExplorer.js	2009-07-01 20:59:51 UTC (rev 1199)
@@ -1431,24 +1431,17 @@
      * :return: an :class:`Object` representing the app's current configuration.
      */ 
     extractConfiguration: function() {
+
+        var center = this.map.getCenter();        
         var config = {
-            ows: {}
+            ows: {},
+            map: {
+                center: [center.lon, center.lat],
+                zoom: this.map.zoom,
+                layers: []
+            }
         };
-
-        // Map configuration
-
-        var center = this.map.getCenter();
         
-        config.map = {
-            center: [center.lon, center.lat],
-            zoom: this.map.zoom
-        };
-
-        var sourcesUsed = {};
-
-        //Layers configuration
-        config.map.layers = [];
-        
         this.layers.each(function(layerRecord){
             var layer = layerRecord.get('layer');
             if (layer.displayInLayerSwitcher) {
@@ -1463,25 +1456,19 @@
                     // Return; error gracefully. (This is debatable.)
                     return;
                 }
-
-                sourcesUsed[source.get("identifier")] = source.get("url");
+                // add source
+                config.ows[source.get("identifier")] = source.get("url");
                 
-                var c = {
+                config.map.layers.push({
                     name: layerRecord.get("name"),
+                    title: layerRecord.get("title"),
                     visibility: layer.getVisibility(),
                     background: layerRecord.get('background'),
                     ows: source.get("identifier")
-                };
-
-                config.map.layers.push(c);
+                });
             }
         }, this);
         
-        // Source configuration
-        for (identifier in sourcesUsed) {
-            config.ows[identifier] = sourcesUsed[identifier];
-        }
-        
         return config;
     },
 



More information about the Commits mailing list