MapControl.Measurements Property
Gets or sets the MapControl Measurements object.
Namespace: DevExpress.Xpf.Map
Assembly: DevExpress.Xpf.Map.v24.2.dll
NuGet Package: DevExpress.Wpf.Map
Declaration
Property Value
Type | Description |
---|---|
Measurements | Contains measurement API to use map rulers. |
Remarks
The following example adds the Measurements object to the Map Control and creates a distance ruler:
<dxm:MapControl x:Name="mapControl1">
<dxm:MapControl.Measurements>
<dxm:Measurements>
<dxm:Measurements.ToolbarOptions>
<dxm:MeasurementToolbarOptions ShowAreaButton="False"/>
</dxm:Measurements.ToolbarOptions>
</dxm:Measurements>
</dxm:MapControl.Measurements>
...
</dxm:MapControl>
MapRuler ruler = mapControl1.Measurements.CreateRuler(RulerType.Distance,
new List<CoordPoint>() {
new GeoPoint(48.864716, 2.349014), // Paris
new GeoPoint(45.46427, 9.18951), // Milan
new GeoPoint(48.20849, 16.37208) // Vienna
});
double distance = ruler.Measurement;
The image below displays the result:
Related API Members:
Member | Description |
---|---|
Contains API to manage rulers that help users measure distances and areas on a map. | |
Specifies whether the Add Area Ruler button is displayed in the Measurements toolbar. | |
Creates a ruler of the specified type to measure the distance or area between coordinate points passed as the second parameter. |
See Also