You are viewing an older version of Mapbox.js. Check out v3.1.0 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( <LatLng[][]> latlngs, <Polyline options> options? ) 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( <LatLng[][]> latlngs ) this Replace all lines and their paths with the given array of arrays of geographical points.
getLatLngs() <LatLng[][]> latlngs 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).