Legacy
Mapbox.js is no longer in active development. To learn more about our newer mapping tools see Mapbox GL JS.
You are viewing an older version of Mapbox.js. Check out v3.3.1 for the latest.
MultiPolyline
Extends FeatureGroup to allow creating multi-polylines (single layer that consists of several polylines that share styling/popup).
Creation
Factory | Description |
---|---|
L.multiPolyline(
|
Instantiates a multi-polyline object given an array of arrays of geographical points (one for each individual polyline) and optionally an options object. |
Methods
MultiPolylines accept all Polyline methods but have different behavior around their coordinate contents since they can contain multiple line features:
Method | Returns | Description |
---|---|---|
setLatLngs(
|
this |
Replace all lines and their paths with the given array of arrays of geographical points. |
getLatLngs() |
|
Returns an array of arrays of geographical points in each line. |
openPopup() |
this |
Opens the popup previously bound by bindPopup. |
toGeoJSON() |
Object |
Returns a GeoJSON representation of the multipolyline (GeoJSON MultiLineString Feature). |