[fusion-commits] r2061 - sandbox/adsk/2.2gp/widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Mon Feb 8 21:14:56 EST 2010


Author: liuar
Date: 2010-02-08 21:14:56 -0500 (Mon, 08 Feb 2010)
New Revision: 2061

Modified:
   sandbox/adsk/2.2gp/widgets/Legend.js
Log:
Port the fix of ticket #306 to this branch

Modified: sandbox/adsk/2.2gp/widgets/Legend.js
===================================================================
--- sandbox/adsk/2.2gp/widgets/Legend.js	2010-02-09 02:13:42 UTC (rev 2060)
+++ sandbox/adsk/2.2gp/widgets/Legend.js	2010-02-09 02:14:56 UTC (rev 2061)
@@ -717,23 +717,25 @@
             opt.label = style.legendLabel == '' ? ' ' : style.legendLabel;
             opt.draw = this.renderItem;
         }
+        
         if (!style) {
             opt.image = this.imgDisabledLayerIcon;
             opt.enabled = false;
         } else {
-           var defaultIcon = this.imgDisabledLayerIcon;
-           if (layer.layerTypes[0] == 4) {
-               if (style.staticIcon == Fusion.Constant.LAYER_DWF_TYPE) {
-                 defaultIcon = this.imgLayerDWFIcon;
-              } else {
-                defaultIcon = this.imgLayerRasterIcon;
-              }
+            if(style.iconOpt && style.iconOpt.url){
+                opt.image = style.iconOpt.url;
+            }else{
+                opt.image = layer.oMap.getLegendImageURL(scale, layer, style);
             }
-            if (style.iconOpt && style.iconOpt.url) {
-                opt.image = style.iconOpt.url;
+        }
+        // MapGuide DWF and Raster layer
+        if (layer.layerTypes[0] == 4) {
+            if (style && style.staticIcon == Fusion.Constant.LAYER_DWF_TYPE) {
+                opt.image = this.imgLayerDWFIcon;
             } else {
-                opt.image = layer.oMap.getLegendImageURL(scale, layer, style, defaultIcon);
+                opt.image = this.imgLayerRasterIcon;
             }
+            opt.enabled = true;
         }
         opt.contextMenu = this.getContextMenu();
 



More information about the fusion-commits mailing list