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

svn_fusion at osgeo.org svn_fusion at osgeo.org
Thu Apr 1 11:12:16 EDT 2010


Author: madair
Date: 2010-04-01 11:12:15 -0400 (Thu, 01 Apr 2010)
New Revision: 2127

Modified:
   trunk/layers/MapGuide/MapGuide.js
   trunk/widgets/Legend.js
Log:
re #376: add checks for existence of oLayerOL2 and checks for style=null in Legend.js 

Modified: trunk/layers/MapGuide/MapGuide.js
===================================================================
--- trunk/layers/MapGuide/MapGuide.js	2010-04-01 03:06:48 UTC (rev 2126)
+++ trunk/layers/MapGuide/MapGuide.js	2010-04-01 15:12:15 UTC (rev 2127)
@@ -44,6 +44,7 @@
     selectionAsOverlay: true,
     useAsyncOverlay: false,
     defaultFormat: 'PNG',
+    oLayerOL2: false,   //a layer object for tiled maps that also contains dynamic layers
 
     initialize: function(map, mapTag, isMapWidgetLayer) {
         // console.log('MapGuide.initialize');
@@ -1021,7 +1022,7 @@
         this.processGroupEvents(group, true);
         if (group.groupName == 'layerRoot') {
             this.oLayerOL.setVisibility(true);
-            this.oLayerOL2.setVisibility(true);
+            if (this.oLayerOL2) this.oLayerOL2.setVisibility(true);
         } else if (group.isBaseMapGroup) {
             this.oLayerOL.setVisibility(true);
         } else {
@@ -1035,7 +1036,7 @@
         this.processGroupEvents(group, false);
         if (group.groupName == 'layerRoot') {
             this.oLayerOL.setVisibility(false);
-            this.oLayerOL2.setVisibility(false);
+            if (this.oLayerOL2) this.oLayerOL2.setVisibility(false);
         } else if (group.isBaseMapGroup) {
             this.oLayerOL.setVisibility(false);
         } else {

Modified: trunk/widgets/Legend.js
===================================================================
--- trunk/widgets/Legend.js	2010-04-01 03:06:48 UTC (rev 2126)
+++ trunk/widgets/Legend.js	2010-04-01 15:12:15 UTC (rev 2127)
@@ -709,11 +709,17 @@
         var opt = {};
         opt.statusIsDefault = layer.statusDefault;
 
+        //set the label
+        if (style && style.legendLabel) {
+            opt.label = style.legendLabel == '' ? ' ' : style.legendLabel;
+        } else {
+            opt.label = layer.legendLabel == '' ? ' ' : layer.legendLabel;
+        }
+
+        //set the checkbox rendererer
         if (bCheckBox ) {
-            opt.label = layer.legendLabel == '' ? ' ' : layer.legendLabel;
             opt.draw = this.renderItemCheckBox;
         } else {
-            opt.label = style.legendLabel == '' ? ' ' : style.legendLabel;
             opt.draw = this.renderItem;
         }
         



More information about the fusion-commits mailing list