Skip to main content
All docs
V24.1

MapLine.EndLineCap Property

Returns MapLine end cap settings.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.1.dll

NuGet Package: DevExpress.Win.Map

Declaration

public MapLineCap EndLineCap { get; }

Property Value

Type Description
MapLineCap

Contains MapLine end cap settings.

Remarks

Use the EndLineCap property to display a shape at the end of a map line. The default cap shape is an arrow. Set the Visible property to true to display the arrow:

MapLine line = new MapLine() { Point1 = new GeoPoint(-3, -10),
                               Point2 = new GeoPoint(0, 0), 
                               StrokeWidth = 2, 
                               Stroke = System.Drawing.Color.Blue };
mapItemStorage1.Items.Add(line);                              
line.EndLineCap.Visible = true;

Result:

Map Line Cap

To display a custom shape, set the MapLineCap.Template property to a MapUnit array that defines a cap template.

Use the MapLineCap.Width and MapLineCap.Length properties to specify dimensions of the default arrow or a custom shape.

The following example defines the end cap template and its dimensions:

MapLine line = new MapLine() { Point1 = new GeoPoint(-3, -10),
                               Point2 = new GeoPoint(0, 0), 
                               StrokeWidth = 2, 
                               Stroke = System.Drawing.Color.Blue };
mapItemStorage1.Items.Add(line);                               
line.EndLineCap.Visible = true;
line.EndLineCap.Length = 30;
line.EndLineCap.Width = 22;
line.EndLineCap.Template = new MapUnit[] { new MapUnit(0, 0),
                                           new MapUnit(-0.5, -0.5),
                                           new MapUnit(0.25, 0),
                                           new MapUnit(-0.5, 0.5),
                                           new MapUnit(0, 0),
};

Result:

Map Line Cap template

The MapLineCap.IsFilled property specifies whether the cap shape is filled:

line.EndLineCap.IsFilled = false;

Map Line Cap IsFilled property is false

When map lines are created based on data source values, use the following API members to map data source fields to end cap properties:

For more examples on MapLine cap property mappings, see the demo:

Run Demo: Map Arrows

See Also