MapPolyline Class
The class used to draw a polyline on a map.
Namespace: DevExpress.XtraMap
Assembly: DevExpress.XtraMap.v19.1.dll
Declaration
public class MapPolyline :
MapShape,
IPointContainerCore,
ISupportCoordPoints,
ISupportIntermediatePoints,
IEditableItem,
ISimplifiableItem
Related API Members
The following members return MapPolyline objects:
Remarks
The following image shows an example of a map polyline object.
Note that, a map shape should fulfill the following condition to cross the 180th meridian: one or several points’ longitudes should exceed the 180 (-180) limit:
MapPolygon polygon = new MapPolygon();
polygon.Points.Add(new GeoPoint(10, -170));
polygon.Points.Add(new GeoPoint(10, 170));
polygon.Points.Add(new GeoPoint(-10, 170));
polygon.Points.Add(new GeoPoint(-10, -170));
vectorItemStorage.Items.Add(polygon);
// Point longitudes enclose the 180 meridian.
MapPolygon polygonCross180 = New MapPolygon();
polygonCross180.Fill = Color.Orange;
polygonCross180.Points.Add(new GeoPoint(30, 190));
polygonCross180.Points.Add(new GeoPoint(30, 170));
polygonCross180.Points.Add(new GeoPoint(20, 170));
polygonCross180.Points.Add(new GeoPoint(20, 190));
vectorItemStorage.Items.Add(polygon180);
The code above produces the following image:
Example
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-create-different-map-shapes-t139819
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);
See Also