[mapguide-commits] r7946 - branches/2.5/MgDev/Desktop/MapViewer

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Dec 2 02:58:39 PST 2013


Author: jng
Date: 2013-12-02 02:58:39 -0800 (Mon, 02 Dec 2013)
New Revision: 7946

Modified:
   branches/2.5/MgDev/Desktop/MapViewer/MgLegendControlPresenter.cs
Log:
mg-desktop: Skip over non-applicable scale ranges for themed layers in legend component

Modified: branches/2.5/MgDev/Desktop/MapViewer/MgLegendControlPresenter.cs
===================================================================
--- branches/2.5/MgDev/Desktop/MapViewer/MgLegendControlPresenter.cs	2013-12-01 17:39:38 UTC (rev 7945)
+++ branches/2.5/MgDev/Desktop/MapViewer/MgLegendControlPresenter.cs	2013-12-02 10:58:39 UTC (rev 7946)
@@ -181,6 +181,9 @@
                         if (type != LAYER_VECTOR)
                             break;
 
+                        if (!LayerNodeMetadata.ScaleIsApplicable(_map.ViewScale, minScale, maxScale))
+                            continue;
+
                         bool bComposite = false;
 
                         //Check TS count. Give precedence to composite type styles
@@ -1105,6 +1108,16 @@
                 return nodes.ToArray();
             }
 
+            internal static bool ScaleIsApplicable(double scale, string minScale, string maxScale)
+            {
+                return ScaleIsApplicable(scale, new ThemeCategory()
+                {
+                    GeometryType = -1,
+                    MinScale = minScale,
+                    MaxScale = maxScale
+                });
+            }
+
             internal static bool ScaleIsApplicable(double scale, ThemeCategory cat)
             {
                 bool bApplicable = false;



More information about the mapguide-commits mailing list