Class ScaleLineAdornmentLayer
The ScaleLineAdornmentLayer is a concrete class inherited from AdornmentLayer. The ScaleLineAdornmentLayer class allows you show a ScaleLine graphic on the map.
public class ScaleLineAdornmentLayer : AdornmentLayer
- Inheritance
-
ScaleLineAdornmentLayer
- Inherited Members
Examples
ScaleLineAdornmentLayer scaleLineAdornmentLayer = new ScaleLineAdornmentLayer();
mapEngine.AdornmentLayers.Add("ScaleLineAdornmentLayer", scaleLineAdornmentLayer);
Dim scaleLineAdornmentLayer As New ScaleLineAdornmentLayer()
mapEngine.AdornmentLayers.Add("ScaleLineAdornmentLayer", scaleLineAdornmentLayer)
Remarks
The ScaleLineAdornmentLayer of the map is a quick way to implement a ScaleLine. When doing this, we also have to add a ScaleLineAdornmentLayer to the map control.
Constructors
ScaleLineAdornmentLayer()
Creates a new instance of the ScaleLineAdornmentLayer class. The default location of this ScaleLineAdornmentLayer is the lower left corner of the CurrentExtent of the map.
public ScaleLineAdornmentLayer()
ScaleLineAdornmentLayer(AdornmentLocation)
Creates a new instance of the ScaleLineAdornmentLayer class by passing in the specified enumeration of the AdornmentLocation that will be used to set the start position of this ScaleLineAdornmentLayer when it is shown on the map.
public ScaleLineAdornmentLayer(AdornmentLocation location)
Parameters
location
AdornmentLocationThis parameter specifies the location of the start point of the ScaleLineAdornmentLayer.
ScaleLineAdornmentLayer(ScreenPointF)
Creates a new instance of the ScaleLineAdornmentLayer class by passing in the specified ScreenPoint, which will be the start position of this ScaleLineAdornmentLayer when it is shown on the map.
public ScaleLineAdornmentLayer(ScreenPointF startPoint)
Parameters
startPoint
ScreenPointFThe start position of the ScaleLineAdornmentLayer that will be shown on the Map.
Properties
DisplayUnitString
This propery is a dictionary that exposes what text will be drawn to represent the ScaleLine Unit.
public Dictionary<string, string> DisplayUnitString { get; }
Property Value
Remarks
We will display different letters for different units of measure; for example: "m" for meters, "ft" for feet, etc.
HaloPen
public GeoPen HaloPen { get; set; }
Property Value
Pen
public GeoPen Pen { get; set; }
Property Value
TextStyle
public TextStyle TextStyle { get; set; }
Property Value
UnitSystem
Gets or sets the UnitSystem to be used for the ScaleLine.
public ScaleLineUnitSystem UnitSystem { get; set; }
Property Value
Remarks
By setting this property, you can set the top and button unit for the ScaleLine.
Methods
CloseCore()
protected override void CloseCore()
DrawCore(GeoCanvas, Collection<SimpleCandidate>)
This method draws the Layer.
protected override void DrawCore(GeoCanvas canvas, Collection<SimpleCandidate> labelsInAllLayers)
Parameters
canvas
GeoCanvasThis parameter is the view object or a NativeImage to draw on.
labelsInAllLayers
Collection<SimpleCandidate>This parameter represents the labels used for collision detection and duplication checking.
Remarks
This abstract method is called from the concrete public method Draw. This
method draws the representation of the layer based on the extent you provided.
When implementing this abstract method, consider each feature and its column data
values. You can use the full power of the GeoCanvas to do the drawing. If you need
column data for a feature, be sure to override the GetRequiredColumnNamesCore and add
the columns you need to the collection. In many of the styles, we add properties to
allow the user to specify which field they need; then, in the GetRequiredColumnNamesCore,
we read that property and add it to the collection.
OpenCore()
protected override void OpenCore()