An overlay made up of connected line segments that do not form a closed shape.
- MapKit JS 5.0+
A polyline is a shape made up of one or more connected line segments defined by a set of points. The first and last points do not connect to each other.
The longitude of all points should be within a 360º degree range. Depending on how you specify the longitude, a line between Tokyo and Los Angeles created with a
mapkit may take a different route. Specifying a longitude of -118º for Los Angeles and 140º for Tokyo will result in a very long line spanning 258º. Specifying a longitude of 242º (i.e., -118 + 360) for Los Angeles and 140º for Tokyo will result in a shorter line spanning 98º. If the range of longitudes is larger than 360º, the result of the rendering is undefined.
style properties apply to polyline overlays except
fill. Properties that don't apply are ignored.
mapkit doesn't implement methods of its own. For more information, see the base object,
The following example shows a polyline object added to the map.