Skip to main content
All docs
V24.1

MapPolylineBase.StartLineCap Property

Returns start cap settings.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.1.dll

NuGet Package: DevExpress.Win.Map

Declaration

public MapLineCap StartLineCap { get; }

Property Value

Type Description
MapLineCap

Contains start cap settings.

Remarks

Use the StartLineCap property to display a shape at the beginning 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.StartLineCap.Visible = true;
polyLine.StartLineCap.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 start 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.StartLineCap.Template = template;
polyLine.StartLineCap.Template = template;

spline.StartLineCap.Length = 20;
spline.StartLineCap.Width = 20;

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

Result:

MapPolyLine and MapSpline Cap template

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

spline.StartLineCap.IsFilled = false;
polyLine.StartLineCap.IsFilled = false;

Map Line Cap IsFilled property is false

See Also