[fusion-commits] r2835 - branches/fusion-mg26/widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Sat May 10 06:54:55 PDT 2014


Author: jng
Date: 2014-05-10 06:54:55 -0700 (Sat, 10 May 2014)
New Revision: 2835

Modified:
   branches/fusion-mg26/widgets/Legend.js
Log:
Fix http://trac.osgeo.org/mapguide/ticket/2445, this is caused by layers that are not visible at the current scale but are set to be shown anyway by the layer widget.

Modified: branches/fusion-mg26/widgets/Legend.js
===================================================================
--- branches/fusion-mg26/widgets/Legend.js	2014-05-10 13:51:02 UTC (rev 2834)
+++ branches/fusion-mg26/widgets/Legend.js	2014-05-10 13:54:55 UTC (rev 2835)
@@ -800,10 +800,10 @@
     createTreeItem: function(layer, style, scale, checkbox) {
         var opt = {};
         opt.statusIsDefault = layer.statusDefault;
-        
+        var range = layer.legend.currentRange;
         //Set the label. Use style label IFF there are more than one style rule.
         //Otherwise layer's legend label takes precedence
-        if (style && layer.legend.currentRange.styles.length > 1) {
+        if (style && range && range.styles.length > 1) {
             opt.label = style.legendLabel == '' ? ' ' : style.legendLabel;
         } else {
             opt.label = layer.legendLabel == '' ? ' ' : layer.legendLabel;



More information about the fusion-commits mailing list