[fusion-commits] r2507 - in trunk: templates/mapguide/standard/images/icons widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Wed Jan 4 02:30:36 EST 2012


Author: jng
Date: 2012-01-03 23:30:36 -0800 (Tue, 03 Jan 2012)
New Revision: 2507

Added:
   trunk/templates/mapguide/standard/images/icons/out-of-range.png
Modified:
   trunk/widgets/Legend.js
Log:
#510: Fix HideInvisibleLayers extension property not working when set to false. The problems were:
 - The tree item replace() function had the parameters in the wrong order.
 - No icon is passed to tree items representing layers outside the current scale.

Added: trunk/templates/mapguide/standard/images/icons/out-of-range.png
===================================================================
(Binary files differ)


Property changes on: trunk/templates/mapguide/standard/images/icons/out-of-range.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Modified: trunk/widgets/Legend.js
===================================================================
--- trunk/widgets/Legend.js	2012-01-04 06:09:23 UTC (rev 2506)
+++ trunk/widgets/Legend.js	2012-01-04 07:30:36 UTC (rev 2507)
@@ -74,6 +74,12 @@
      */
     defaultGroupInfoIcon: 'images/icons/group-info.png',
     
+    /**
+     * Constant: outOfRangeIcon
+     * {String}: The default image for layers outside the current visible scale range
+     */
+    outOfRangeIcon: 'images/icons/out-of-range.png',
+    
     initializeWidget: function(widgetTag) {
         // TODO: maybe it's a good idea to do a function like Fusion.Widget.BindRenderer.. for limit the code
         // duplication if we plan to apply this pattern to others widgets
@@ -636,9 +642,9 @@
                     layer.legend.treeItem = null;
                 }
             } else {
-              var newTreeItem = this.createTreeItem(layer, {legendLabel: layer.legendLabel}, null, !layer.isBaseMapLayer);
+              var newTreeItem = this.createTreeItem(layer, {legendLabel: layer.legendLabel, iconOpt: { url: this.oLegend.outOfRangeIcon } }, null, !layer.isBaseMapLayer);
                 if (layer.legend.treeItem) {
-                    layer.parentGroup.legend.treeItem.replace(newTreeItem, layer.legend.treeItem);
+                    layer.parentGroup.legend.treeItem.replace(layer.legend.treeItem, newTreeItem);
                     layer.legend.treeItem.finalize();
                 } else {
                     layer.parentGroup.legend.treeItem.add(newTreeItem);



More information about the fusion-commits mailing list