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.Maui
Assembly: Esri.ArcGISRuntime.Toolkit.Maui.dll
Syntax
public class ScaleLine : TemplatedView
Constructors
| Improve this Doc View SourceScaleLine()
Initializes a new instance of the ScaleLine class.
Declaration
public ScaleLine()
Fields
| Improve this Doc View SourceColorProperty
Identifies the Color bindable property.
Declaration
public static readonly BindableProperty ColorProperty
Field Value
Type | Description |
---|---|
BindableProperty |
MapScaleProperty
Identifies the MapScale bindable property.
Declaration
public static readonly BindableProperty MapScaleProperty
Field Value
Type | Description |
---|---|
BindableProperty |
MapViewProperty
Identifies the
Declaration
public static readonly BindableProperty MapViewProperty
Field Value
Type | Description |
---|---|
BindableProperty |
TargetWidthProperty
Identifies the TargetWidth bindable property.
Declaration
public static readonly BindableProperty TargetWidthProperty
Field Value
Type | Description |
---|---|
BindableProperty |
Properties
| Improve this Doc View SourceColor
Gets or sets the Color that will be used for the scale line parts.
Declaration
public Color Color { get; set; }
Property Value
Type | Description |
---|---|
Color |
MapScale
Gets or sets the scale that the ScaleLine will use to calculate scale in metric and imperial units.
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()