Skip to main content

MapPolyline Class

Contains map polyline settings.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.2.dll

Declaration

public class MapPolyline :
    MapPolylineBase

The following members return MapPolyline objects:

Remarks

Create a Map Polyline

The following example creates a map polyline:

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);

View Example

Add Polyline Caps

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:

Map Spline Caps

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);

Inheritance

See Also