windowsforms-devexpress-dot-xtramap-dot-mappolylinebase-8b765ffa.md
Returns end cap settings.
Namespace : DevExpress.XtraMap
Assembly : DevExpress.XtraMap.v25.2.dll
NuGet Package : DevExpress.Win.Map
public MapLineCap EndLineCap { get; }
Public ReadOnly Property EndLineCap As MapLineCap
| Type | Description |
|---|---|
| MapLineCap |
Contains end cap settings.
|
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;
Dim spline As MapSpline = New MapSpline() With {
.StrokeWidth = 2,
.Stroke = Drawing.Color.Blue
}
spline.Points.AddRange(New GeoPoint() {New GeoPoint(-6, -4),
New GeoPoint(-3, -10),
New GeoPoint(-6, -20)})
mapItemStorage1.Items.Add(spline)
Dim polyLine As MapPolyline = New MapPolyline() With {
.StrokeWidth = 2,
.Stroke = 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:
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;
Dim template As MapUnit() = 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:
The MapLineCap.IsFilled property specifies whether the cap shape is filled:
spline.EndLineCap.IsFilled = false;
polyLine.EndLineCap.IsFilled = false;
spline.EndLineCap.IsFilled = False
polyLine.EndLineCap.IsFilled = False
See Also