Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

MapPolylineBase.EndLineCap Property

Returns end cap settings.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.2.dll

NuGet Package: DevExpress.Win.Map

#Declaration

public MapLineCap EndLineCap { get; }

#Property Value

Type Description
MapLineCap

Contains end cap settings.

#Remarks

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

MapSpline spline = new MapSpline() { StrokeWidth = 2, Stroke = System.Drawing.Color.Blue };
spline.Points.AddRange(new GeoPoint[] {
                          new GeoPoint(-6, -4),
                          new GeoPoint(-3, -10),
                          new GeoPoint(-6, -20) });
mapItemStorage1.Items.Add(spline);

MapPolyline polyLine = new MapPolyline() { StrokeWidth = 2, Stroke = System.Drawing.Color.Blue };
polyLine.Points.AddRange(new GeoPoint[] {
                         new GeoPoint(-11, -4),
                         new GeoPoint(-8, -10),
                         new GeoPoint(-11, -20) });
mapItemStorage1.Items.Add(polyLine);

spline.EndLineCap.Visible = true;
polyLine.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 code defines the end cap template and its dimensions:

MapUnit[] template = new MapUnit[] {new MapUnit(0, 0),
                                    new MapUnit(-0.5, -0.5),
                                    new MapUnit(0.45, 0),
                                    new MapUnit(-0.5, 0.5),
                                    new MapUnit(0, 0)};
spline.EndLineCap.Template = template;
polyLine.EndLineCap.Template = template;

spline.EndLineCap.Length = 20;
spline.EndLineCap.Width = 20;

polyLine.EndLineCap.Length = 35;
polyLine.EndLineCap.Width = 22;

Result:

MapPolyLine and MapSpline Cap template

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

spline.EndLineCap.IsFilled = false;
polyLine.EndLineCap.IsFilled = false;

Map Line Cap IsFilled property is false

See Also