windowsforms-devexpress-dot-xtramap-7e1ef51e.md
Contains map polyline settings.
Namespace : DevExpress.XtraMap
Assembly : DevExpress.XtraMap.v25.2.dll
NuGet Package : DevExpress.Win.Map
public class MapPolyline :
MapPolylineBase
Public Class MapPolyline
Inherits MapPolylineBase
The following members return MapPolyline objects:
The following example creates a map polyline:
var polyline = new MapPolyline() { StrokeWidth = 4, Stroke = Color.Yellow };
polyline.Points.AddRange(new GeoPoint[] {
new GeoPoint(-29,130),
new GeoPoint(-40,140),
new GeoPoint(-20,150)
});
ItemStorage.Items.Add(polyline);
Dim polyline = New MapPolyline() With {.StrokeWidth = 4, .Stroke = Color.Yellow}
polyline.Points.AddRange(New GeoPoint() {New GeoPoint(-29, 130), New GeoPoint(-40, 140), New GeoPoint(-20, 150)})
ItemStorage.Items.Add(polyline)
You can display shapes at the beginning and at the end of map polylines. Use StartLineCap and EndLineCap properties for this purpose. The following example specifies the end cap template and shows the default arrow for the polyline start cap:
MapPolyline polyline = new MapPolyline() { StrokeWidth = 2,
Stroke = System.Drawing.Color.Blue };
polyline.Points.AddRange(new GeoPoint[] { new GeoPoint(-6, -4),
new GeoPoint(-3, -10),
new GeoPoint(-6, -20) });
polyline.StartLineCap.Visible = true;
polyline.StartLineCap.Length = 20;
polyline.StartLineCap.Width = 10;
polyline.EndLineCap.Visible = true;
polyline.EndLineCap.Template = new MapUnit[] { new MapUnit(-0.5, 0),
new MapUnit(0, 0.5),
new MapUnit(0.5, 0),
new MapUnit(0, -0.5)};
polyline.EndLineCap.Length = 10;
polyline.EndLineCap.Width = 10;
ItemStorage.Items.Add(polyline);
Dim polyline As MapPolyline = New MapPolyline() With {.StrokeWidth = 2,
.Stroke = Drawing.Color.Blue}
polyline.Points.AddRange(New GeoPoint() { New GeoPoint(-6, -4),
New GeoPoint(-3, -10),
New GeoPoint(-6, -20)})
polyline.StartLineCap.Visible = True
polyline.StartLineCap.Length = 20
polyline.StartLineCap.Width = 10
polyline.EndLineCap.Visible = True
polyline.EndLineCap.Template = New MapUnit() { New MapUnit(-0.5, 0),
New MapUnit(0, 0.5),
New MapUnit(0.5, 0),
New MapUnit(0, -0.5)}
polyline.EndLineCap.Length = 10
polyline.EndLineCap.Width = 10
ItemStorage.Items.Add(polyline)
Object MapItem MapShape MapPolylineBase MapPolyline
See Also