[fusion-commits] r2810 - trunk/widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Wed Nov 13 22:32:04 PST 2013


Author: jng
Date: 2013-11-13 22:32:03 -0800 (Wed, 13 Nov 2013)
New Revision: 2810

Modified:
   trunk/widgets/Legend.js
Log:
Before rendering a disabled layer icon, do check if the layer in question is a DWF or Raster layer. They may be the reason why there is no style information for such layers in the LoadScaleRanges.php JSON response.

Modified: trunk/widgets/Legend.js
===================================================================
--- trunk/widgets/Legend.js	2013-11-14 05:06:24 UTC (rev 2809)
+++ trunk/widgets/Legend.js	2013-11-14 06:32:03 UTC (rev 2810)
@@ -815,9 +815,24 @@
           opt.selectable = false;
         }
 
+        var LAYER_RASTER = 4;
+        var LAYER_DWF = 5;
+
         if (!style) {
-            opt.image = this.imgDisabledLayerIcon;
-            opt.enabled = false;
+            //This could be a DWF or Raster layer
+            if (layer.layerTypes.length == 1) {
+                if (layer.layerTypes[0] == LAYER_RASTER) {
+                    opt.image = this.imgLayerRasterIcon;
+                } else if (layer.layerTypes[0] == LAYER_DWF) {
+                    opt.image = this.imgLayerDWFIcon;
+                } else {
+                    opt.image = this.imgDisabledLayerIcon;
+                    opt.enabled = false;
+                }
+            } else {
+                opt.image = this.imgDisabledLayerIcon;
+                opt.enabled = false;
+            }
         } else {
             if(style.iconOpt && style.iconOpt.url){
                 opt.image = style.iconOpt.url;



More information about the fusion-commits mailing list