[mapguide-commits] r8039 - trunk/MgDev/Web/src/viewerfiles

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Apr 14 04:13:09 PDT 2014


Author: jng
Date: 2014-04-14 04:13:09 -0700 (Mon, 14 Apr 2014)
New Revision: 8039

Modified:
   trunk/MgDev/Web/src/viewerfiles/legendui.templ
Log:
#2416: Fix theme rules for a layer with multiple scale ranges stay shown in the legend if moving back to a scale range where that layer has no theme rules.

Modified: trunk/MgDev/Web/src/viewerfiles/legendui.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/legendui.templ	2014-04-14 01:00:57 UTC (rev 8038)
+++ trunk/MgDev/Web/src/viewerfiles/legendui.templ	2014-04-14 11:13:09 UTC (rev 8039)
@@ -1015,6 +1015,24 @@
                 {
                     // the layer's theme will be changed on demand
                     node.children[nodeCurScale].iconWasRequested = false;
+                    var bCurrentScaleThemed = (node.children[nodeCurScale].children.length > 1);
+                    var themeEl = document.getElementById('ChildrenOf_' + node.objectId);
+                    if (bCurrentScaleThemed && themeEl) {
+                        themeEl.style.display = "block";
+                    }
+                    for (var i = 0; i < node.children.length; i++) {
+                        if (i == nodeCurScale) {
+                            continue;
+                        } else {
+                            // Need to hide any previously set theme rule HTML for other scales
+                            var bThemed = (node.children[i].children.length > 1);
+                            if (bThemed && !bCurrentScaleThemed) {
+                                if (themeEl)
+                                    themeEl.style.display = "none";
+                            }
+                        }
+                    }
+                    
                     // the layer's legend image will be changed immediately
                     if(!HasCollapsedParent(node))
                     {



More information about the mapguide-commits mailing list