A newer version of this page is available. Switch to the current version.

GeoUtils.CalculateArea(MapShape) Method

Computes the closed shape area.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v19.2.dll

Declaration

public static double CalculateArea(
    MapShape shape
)
Public Shared Function CalculateArea(
    shape As MapShape
) As Double

Parameters

Name Type Description
shape MapShape

The closed map shape whose area is calculated.

Returns

Type Description
Double

The map shape area in squire meters.

Remarks

You can use the CalculateArea method to determine an area of the following vector items:

The following example shows how to compute the selected map shape's area:

private void mapControl_SelectionChanged(object sender, MapSelectionChangedEventArgs e) {
    MapShape mapShape = vectorItemsLayer.SelectedItem as MapShape;
    double areaByShape = GeoUtils.CalculateArea(mapShape)/1000000;
    label.Text = $"Shape Area: {areaByShape:F2} km²";   
}
See Also