[fusion-commits] r2770 - in trunk: lib widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Tue Aug 27 04:40:25 PDT 2013


Author: jng
Date: 2013-08-27 04:40:25 -0700 (Tue, 27 Aug 2013)
New Revision: 2770

Modified:
   trunk/lib/Map.js
   trunk/widgets/MapMenu.js
Log:
#593: Fix issues in the MapMenu widget:
 - Make the menu items toggle-able (by containing them in a Jx.ButtonSet in addition to adding them to the menu normally)
 - Remove the "AppDef initial view is outside map maxExtent, resetting initialView to maxExtent" error message when switching maps. The error is insignificant.
 - Fix syntax error in the data.maps[i].layerOptions.projection expression which was expected to be a string (presumably in "EPSG:XXXX" format), but in some cases could be an OpenLayers.Projection.

Modified: trunk/lib/Map.js
===================================================================
--- trunk/lib/Map.js	2013-08-23 12:29:20 UTC (rev 2769)
+++ trunk/lib/Map.js	2013-08-27 11:40:25 UTC (rev 2770)
@@ -1177,7 +1177,6 @@
             initialExtents.transform(iv.projection, mapProj);
           }
           if (!initialExtents.intersectsBounds(this.maxExtent)) {
-            Fusion.reportError("AppDef initial view is outside map maxExtent, resetting initialView to maxExtent");
             initialExtents = this.maxExtent;
           }
       } else {

Modified: trunk/widgets/MapMenu.js
===================================================================
--- trunk/widgets/MapMenu.js	2013-08-23 12:29:20 UTC (rev 2769)
+++ trunk/widgets/MapMenu.js	2013-08-27 11:40:25 UTC (rev 2770)
@@ -80,6 +80,7 @@
         
         var mapGroups = Fusion.applicationDefinition.mapGroups;
         this.mapGroupData = {};
+        var buttonSet = new Jx.ButtonSet();
         for (var key in mapGroups) {
             if (mapGroups[key].mapId) {
                 var mapGroup = mapGroups[key];
@@ -89,8 +90,10 @@
                     var data = mapGroup;
                     var menuItem = new Jx.Menu.Item({
                         label: mapGroup.mapId,
+                        toggle: true,
                         onClick: OpenLayers.Function.bind(this.switchMap, this, data)
                     });
+                    buttonSet.add(menuItem);
                     this.uiObj.add(menuItem);
                 }
             }
@@ -268,7 +271,15 @@
           var dest = null;
           for (var i=0; i<data.maps.length; ++i) {
             if (data.maps[i].layerOptions && data.maps[i].layerOptions.projection) {
-              dest = new OpenLayers.Projection(data.maps[i].layerOptions.projection);
+              //This may not be an "EPSG:XXXX" string. It could already be an OpenLayers.Projection
+              //so re-use it if that's the case
+              var oProj = data.maps[i].layerOptions.projection;
+              var projCode = "";
+              if (oProj instanceof OpenLayers.Projection)
+                dest = oProj;
+              else
+                dest = new OpenLayers.Projection(oProj);
+                
               if (data.maps[i].layerOptions.isBaseLayer) {
                 break;
               }



More information about the fusion-commits mailing list