Class ScaleLine
The ScaleLine Control generates a line representing a certain distance on the map in both Metric and US units.
Namespace: Esri.ArcGISRuntime.Toolkit.UI.Controls
Assembly: Esri.ArcGISRuntime.Toolkit.WinUI.dll
Syntax
public class ScaleLine : Control
Constructors
| Improve this Doc View SourceScaleLine()
Initializes a new instance of the ScaleLine class.
Declaration
public ScaleLine()
Fields
| Improve this Doc View SourceMapScaleProperty
The dependency property for the Scale property.
Declaration
public static readonly DependencyProperty MapScaleProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
MapViewProperty
Identifies the
Declaration
public static readonly DependencyProperty MapViewProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
TargetWidthProperty
Identifies the dependency property for the TargetWidth property.
Declaration
public static readonly DependencyProperty TargetWidthProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceMapScale
Declaration
public double MapScale { get; set; }
Property Value
Type | Description |
---|---|
Double |
See Also
| Improve this Doc View SourceMapView
Gets or sets the MapView property that can be attached to a Scaleline control to accurately set the scale, instead of setting the MapScale property directly.
Declaration
public MapView? MapView { get; set; }
Property Value
Type | Description |
---|---|
Nullable<MapView> |
TargetWidth
Gets or sets the width that will be used to calculate the length of the ScaleLine.
Declaration
public double TargetWidth { get; set; }
Property Value
Type | Description |
---|---|
Double |
Methods
| Improve this Doc View SourceCalculateScale(Nullable<Geometry.Polygon>, Double)
Calculates the scale at the center of a polygon, at a given pixel size.
Declaration
public static double CalculateScale(Geometry.Polygon? visibleArea, double unitsPerPixel)
Parameters
Type | Name | Description |
---|---|---|
Nullable<Geometry.Polygon> | visibleArea | The area which center the scale will be calculated for. |
Double | unitsPerPixel | The size of a device indepedent pixel in the units of the spatial reference. |
Returns
Type | Description |
---|---|
Double | The MapScale for the center of the view. |
Remarks
A pixel is a device independent logical pixel - ie 1/96 inches.
OnApplyTemplate()
Declaration
protected override void OnApplyTemplate()