[fusion-commits] r2755 - in trunk: layers/MapGuide widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Wed Jul 31 18:23:36 PDT 2013


Author: liuar
Date: 2013-07-31 18:23:36 -0700 (Wed, 31 Jul 2013)
New Revision: 2755

Modified:
   trunk/layers/MapGuide/MapGuide.js
   trunk/widgets/Legend.js
Log:
Fix MGOS ticket #2329: Legend is not correctly displayed.
This submission fixed the legend issue of flexible web layout. 
1. The field layer.layerTypes doesn't indicate the layer is a DWF or Raster layer any more. We cannot set legend icon according to the value.
2. For layers which doesn't have scale ranges (e.g. drawing layer), we need add a dummy scale range for it. Otherwise, the legend tree will not display correctly.

Modified: trunk/layers/MapGuide/MapGuide.js
===================================================================
--- trunk/layers/MapGuide/MapGuide.js	2013-07-30 01:19:01 UTC (rev 2754)
+++ trunk/layers/MapGuide/MapGuide.js	2013-08-01 01:23:36 UTC (rev 2755)
@@ -423,8 +423,17 @@
                     }
                     clsr.scaleRanges.push(csr);
                 }
+            } else {
+                //For a drawing layer which doesn't have scale ranges, we need add a dummy scale range for it.
+                //Otherwise, the legend tree will not display correctly.
+                minScale = 0;
+                maxScale = 1.0e10;
+                clsr.scaleRanges.push(new Fusion.Layers.ScaleRange({
+                    minScale: 0,
+                    maxScale: 1.0e10}, 
+                    Fusion.Constant.LAYER_DWF_TYPE, {label:lyr.layerName}));
             }
-            
+
             for (var lt in ltypes)
                 cl.layerTypes.push(lt);
             

Modified: trunk/widgets/Legend.js
===================================================================
--- trunk/widgets/Legend.js	2013-07-30 01:19:01 UTC (rev 2754)
+++ trunk/widgets/Legend.js	2013-08-01 01:23:36 UTC (rev 2755)
@@ -825,18 +825,7 @@
                 opt.image = layer.oMap.getLegendImageURL(scale, layer, style);
             }
         }
-        // MapGuide DWF and Raster layer
-         // MapGuide Raster and DWF layer
 
-        if(layer.layerTypes[0] == 4){
-            opt.image = this.imgLayerRasterIcon;
-            opt.enabled = true;
-        } else if(layer.layerTypes[0] == 5){
-            opt.image = this.imgLayerDWFIcon;
-            opt.enabled = true;
-        }
-
-
         var item;
         if (!layer.isBaseMapLayer&&checkbox) {
             // opt.contextMenu = this.getContextMenu();



More information about the fusion-commits mailing list