[mapguide-commits] r6226 - trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Nov 15 07:33:57 EST 2011


Author: jng
Date: 2011-11-15 04:33:56 -0800 (Tue, 15 Nov 2011)
New Revision: 6226

Modified:
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs
Log:
Add a IsVisibleAtScale API to check for potential layer visibility

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs	2011-11-15 11:39:40 UTC (rev 6225)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs	2011-11-15 12:33:56 UTC (rev 6226)
@@ -811,5 +811,23 @@
 
             base.OnPropertyChanged(propertyName);
         }
+
+        /// <summary>
+        /// Determines whether this layer is potentially visible at the specified scale
+        /// </summary>
+        /// <remarks>
+        /// Current layer visibility does not factor into the final result
+        /// </remarks>
+        /// <param name="scale">The scale to check for potential visibility</param>
+        /// <returns></returns>
+        public bool IsVisibleAtScale(double scale)
+        {
+            for (int i = 0; i < _scaleRanges.Length; i += 2) 
+            {
+                if (scale >= _scaleRanges[i] && scale <= _scaleRanges[i + 1])
+                    return true;
+            }
+            return false;
+        }
     }
 }



More information about the mapguide-commits mailing list