Back to Devexpress

MapControl.Measurements Property

windowsforms-devexpress-dot-xtramap-dot-mapcontrol-4fcc734e.md

latest4.4 KB
Original Source

MapControl.Measurements Property

Returns the MapControl Measurements object.

Namespace : DevExpress.XtraMap

Assembly : DevExpress.XtraMap.v25.2.dll

NuGet Package : DevExpress.Win.Map

Declaration

csharp
public Measurements Measurements { get; }
vb
Public ReadOnly Property Measurements As Measurements

Property Value

TypeDescription
Measurements

Contains measurement API to use map rulers.

|

Remarks

The following example specifies Measurements settings in code:

csharp
mapControl1.Measurements.ShowToolbar = true;
mapControl1.Measurements.ToolbarOptions.ShowAreaButton = false;
mapControl1.Measurements.ToolbarOptions.ShowDistanceButton = true;
mapControl1.Measurements.ToolbarOptions.ButtonSize = new Size(30, 30);
MapRuler ruler = mapControl1.Measurements.CreateRuler( RulerType.Distance, 
                                                        new List<CoordPoint>() { 
                                                            new GeoPoint(48.864716, 2.349014),
                                                            new GeoPoint(45.46427, 9.18951),
                                                            new GeoPoint(48.20849, 16.37208) });
vb
mapControl1.Measurements.ShowToolbar = True
mapControl1.Measurements.ToolbarOptions.ShowAreaButton = False
mapControl1.Measurements.ToolbarOptions.ShowDistanceButton = True
mapControl1.Measurements.ToolbarOptions.ButtonSize = New Size(30, 30)
Dim ruler As MapRuler = mapControl1.Measurements.CreateRuler(RulerType.Distance, 
                                                              New List(Of CoordPoint)() From { 
                                                                  New GeoPoint(48.864716, 2.349014),
                                                                  New GeoPoint(45.46427, 9.18951),
                                                                  New GeoPoint(48.20849, 16.37208)})

The image below displays the result:

Related API Members:

|

Member

|

Description

| | --- | --- | |

Measurements

|

Contains API to manage rulers that help users measure distances and areas on a map.

| |

ShowToolbar

|

Specifies whether the Measurements toolbar is displayed.

| |

ShowAreaButton

|

Specifies whether the Add Area Ruler button is displayed in the Measurements toolbar.

| |

ShowDistanceButton

|

Specifies whether the Add Distance Ruler button is displayed in the Measurements toolbar.

| |

ButtonSize

|

Sets the size of buttons in the Measurements toolbar.

| |

CreateRuler(RulerType, IList<CoordPoint>)

|

Creates a ruler of the specified type to measure the distance or area between coordinate points passed as the second parameter.

|

See Also

Measurements

MapControl Class

MapControl Members

DevExpress.XtraMap Namespace