--- layout: api title: "v2.1.1 JavaScript Library: L.MultiPolyline" categories: api version: v2.1.1 permalink: /api/v2.1.1/l-multipolyline ---

## 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).