[Commits] r915 - apps/opengeo/geoexplorer/trunk/lib/GeoExplorer

commits at geoext.org commits at geoext.org
Fri May 29 22:13:56 CEST 2009


Author: sbenthall
Date: 2009-05-29 22:13:56 +0200 (Fri, 29 May 2009)
New Revision: 915

Modified:
   apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/CapabilitiesGrid.js
Log:
adding layers now effectively clones layers in copied records


Modified: apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/CapabilitiesGrid.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/CapabilitiesGrid.js	2009-05-29 20:12:58 UTC (rev 914)
+++ apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/CapabilitiesGrid.js	2009-05-29 20:13:56 UTC (rev 915)
@@ -95,11 +95,13 @@
         
         var record, layer;
         for(var i = 0; i < records.length; i++){
-            // ??? When this happens, the layer needs to be cloned.
-            // I believe that current in GeoExt trunk, a copy is a shallow
-            // copy.
             Ext.data.Record.AUTO_ID++;
             record = records[i].copy(Ext.data.Record.AUTO_ID);
+
+            layer = record.get("layer").clone();
+            record.set("layer", null); //need to do this because record.set compares String(value) to determine equality (dumb)
+            record.set("layer", layer);
+
             /*
              * TODO: deal with srs and maxExtent
              * At this point, we need to think about SRS if we want the layer to
@@ -107,7 +109,7 @@
              * only.  This will have to be made more generic for apps that use
              * other srs.
              */
-            layer = record.get("layer");
+
             layer.restrictedExtent = OpenLayers.Bounds.fromArray(record.get("llbbox"));
 
             if (this.alignToGrid) {



More information about the Commits mailing list