Class MapPolylineItem

All Implemented Interfaces:
IFeedbackProvider, IDrawable, EventListener

public class MapPolylineItem extends AMapMultiPointItem
A map-native open polyline defined by an ordered array of geographic vertices, with each consecutive segment rendered as a great-circle arc.

Use cases

Flight routes, ship tracks, hiking trails, pipeline routes, or any sequence of waypoints that should follow the surface of the Earth rather than a straight line in projection space.

Geometry

Each edge between adjacent vertices is sampled as a great-circle arc by MapGraphics, which handles seam splitting automatically for global projections. The polyline is open: the last vertex is not connected back to the first. To create a closed shape use MapPolygonItem.

Interaction

  • Drag — moves all vertices by the geographic delta of the mouse.
  • Resize — moves the grabbed handle vertex to the cursor.
  • Rotate — not supported (see AMapMultiPointItem class doc).

Creation

Typically created by MapToolHandler from a polyline rubberband gesture:


 Point2D.Double[] latLons = ...; // convert screen vertices to geographic
 MapPolylineItem item = new MapPolylineItem(layer, latLons);