[Commits] r1058 - apps/opengeo/geoexplorer/branches/0.1.x/lib/GeoExplorer

commits at geoext.org commits at geoext.org
Fri Jun 12 01:46:00 CEST 2009


Author: tschaub
Date: 2009-06-12 01:46:00 +0200 (Fri, 12 Jun 2009)
New Revision: 1058

Modified:
   apps/opengeo/geoexplorer/branches/0.1.x/lib/GeoExplorer/CapabilitiesGrid.js
Log:
Add newRecords of course.

Modified: apps/opengeo/geoexplorer/branches/0.1.x/lib/GeoExplorer/CapabilitiesGrid.js
===================================================================
--- apps/opengeo/geoexplorer/branches/0.1.x/lib/GeoExplorer/CapabilitiesGrid.js	2009-06-11 23:24:08 UTC (rev 1057)
+++ apps/opengeo/geoexplorer/branches/0.1.x/lib/GeoExplorer/CapabilitiesGrid.js	2009-06-11 23:46:00 UTC (rev 1058)
@@ -127,13 +127,15 @@
          * sake of simplicity, lets assume they goes under the first vector
          * layer found.
          */
-        var index = this.mapPanel.layers.findBy(function(r) {
-            return r.get("layer") instanceof OpenLayers.Layer.Vector;
-        });
-        if(index !== -1) {
-            this.mapPanel.layers.insert(index, records);
-        } else {
-            this.mapPanel.layers.add(records);
+        if(newRecords.length) {
+            var index = this.mapPanel.layers.findBy(function(r) {
+                return r.get("layer") instanceof OpenLayers.Layer.Vector;
+            });
+            if(index !== -1) {
+                this.mapPanel.layers.insert(index, newRecords);
+            } else {
+                this.mapPanel.layers.add(newRecords);
+            }
         }
 
     }



More information about the Commits mailing list