[fusion-commits] r1905 - trunk/lib

svn_fusion at osgeo.org svn_fusion at osgeo.org
Wed Sep 23 10:21:43 EDT 2009


Author: zjames
Date: 2009-09-23 10:21:42 -0400 (Wed, 23 Sep 2009)
New Revision: 1905

Modified:
   trunk/lib/Map.js
Log:
fixes 297: look for extent in non-generic layers first

Modified: trunk/lib/Map.js
===================================================================
--- trunk/lib/Map.js	2009-09-22 16:39:26 UTC (rev 1904)
+++ trunk/lib/Map.js	2009-09-23 14:21:42 UTC (rev 1905)
@@ -649,9 +649,9 @@
             initialExtents = this.maxExtent;
           }
       } else {
-        initialExtents = new OpenLayers.Bounds();
-        for (var i=0; i<this.aMaps.length; ++i) {
-          initialExtents.extend(this.aMaps[i].getMaxExtent());
+        initialExtents = this.getMapGroupExtent();
+        if (!initialExtents) {
+            initialExtents = this.getMapGroupExtent(true);
         }
       }
       this.initialExtents = initialExtents;
@@ -659,6 +659,20 @@
     },
 
     /**
+     * sets the extent by examining all mapgroup map extents
+     */
+    getMapGroupExtent: function(includeGenericLayers) {
+      var initialExtent;
+      for (var i=0; i<this.aMaps.length; ++i) {
+        if (!includeGenericLayers && this.aMaps[i].arch == 'Generic') {
+            continue;
+        }
+        initialExtent = this.aMaps[i].getMaxExtent();
+      }
+      return initialExtent;
+    },
+
+    /**
      * sets the extent of the map to the max as returned by loadMap
      */
     fullExtents: function() {



More information about the fusion-commits mailing list