[mapguide-commits] r7948 - trunk/MgDev/Desktop/MapViewer

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Dec 2 03:18:01 PST 2013


Author: jng
Date: 2013-12-02 03:18:01 -0800 (Mon, 02 Dec 2013)
New Revision: 7948

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

Modified: trunk/MgDev/Desktop/MapViewer/MgLegendControlPresenter.cs
===================================================================
--- trunk/MgDev/Desktop/MapViewer/MgLegendControlPresenter.cs	2013-12-02 11:14:03 UTC (rev 7947)
+++ trunk/MgDev/Desktop/MapViewer/MgLegendControlPresenter.cs	2013-12-02 11:18:01 UTC (rev 7948)
@@ -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