[mapguide-commits] r6245 -
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Nov 22 10:11:53 EST 2011
Author: jng
Date: 2011-11-22 07:11:53 -0800 (Tue, 22 Nov 2011)
New Revision: 6245
Modified:
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs
Log:
Add a ScaleRanges property to RuntimeMapLayer. This is a read-only array of applicable scale ranges for this layer.
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs 2011-11-22 15:03:24 UTC (rev 6244)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs 2011-11-22 15:11:53 UTC (rev 6245)
@@ -58,11 +58,34 @@
/// <value>The type.</value>
public Type Type { get; set; }
}
+
/// <summary>
/// Represents a runtime map layer
/// </summary>
public class RuntimeMapLayer : MapObservable
{
+ /// <summary>
+ /// Represents a scale range
+ /// </summary>
+ public class ScaleRange
+ {
+ internal ScaleRange(double minVal, double maxVal)
+ {
+ this.MinScale = minVal;
+ this.MaxScale = maxVal;
+ }
+
+ /// <summary>
+ /// Gets the min scale.
+ /// </summary>
+ public double MinScale { get; private set; }
+
+ /// <summary>
+ /// Gets the max scale.
+ /// </summary>
+ public double MaxScale { get; private set; }
+ }
+
//From MgLayerType
internal const int kBaseMap = 2;
internal const int kDynamic = 1;
@@ -213,8 +236,19 @@
_scaleRanges[maxPos] = temp;
}
}
+ List<ScaleRange> ranges = new List<ScaleRange>();
+ for (int i = 0; i < scaleCount; i++)
+ {
+ ranges.Add(new ScaleRange(_scaleRanges[i * 2], _scaleRanges[i * 2 + 1]));
+ }
+ this.ScaleRanges = ranges.ToArray();
}
+ /// <summary>
+ /// Gets the applicable scale ranges for this layer
+ /// </summary>
+ public ScaleRange[] ScaleRanges { get; private set; }
+
private void InitIdentityProperties(IVectorLayerDefinition vl)
{
var fs = (IFeatureSource)this.Parent.ResourceService.GetResource(vl.ResourceId);
More information about the mapguide-commits
mailing list