Skip to main content
All docs
V24.1

MapControl.Measurements Property

Gets or sets the MapControl Measurements object.

Namespace: DevExpress.Xpf.Map

Assembly: DevExpress.Xpf.Map.v24.1.dll

NuGet Package: DevExpress.Wpf.Map

Declaration

public Measurements Measurements { get; set; }

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:

Map Control Measurements

Related API Members:

Member

Description

Measurements

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

ShowAreaButton

Specifies whether the Add Area Ruler button is displayed 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