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

GeoUtils.CalculateStrokeLength(MapShape) Method

Returns the map shape's stroke length in meters.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v19.2.dll


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


Name Type Description
shape MapShape

The map shape whose stroke length should be calculated.


Type Description

The map shape stroke length in meters.


You can use the CalculateStrokeLength method to determine the stroke length of the following vector items:

The following code computes a selected map item's stroke length.

private void mapControl_SelectionChanged(object sender, MapSelectionChangedEventArgs e) {
    MapShape mapShape = vectorItemsLayer.SelectedItem as MapShape;
    double strokeLength = GeoUtils.CalculateStrokeLength(mapShape);           
    label.Text = $"StokeLength: {strokeLength / 1000:F2} km";
See Also