--- layout: api title: "v2.2.0 JavaScript Library: L.MultiPolygon" categories: api version: v2.2.0 permalink: /api/v2.2.0/l-multipolygon ---

## MultiPolygon

Extends FeatureGroup to allow creating multi-polygons (single layer that consists of several polygons that share styling/popup).

### Creation

Factory | Description
--- | ---
`L.multiPolygon( <LatLng[][]> latlngs, <Polyline options> options? )` | Instantiates a multi-polygon object given an array of latlngs arrays (one for each individual polygon) and optionally an options object (the same as for MultiPolyline).

### Methods

MultiPolygons accept all Polyline methods but have different behavior around their coordinate contents since they can contain multiple polygon features:

Method | Returns | Description
--- | --- | ---
`setLatLngs( <LatLng[][]> latlngs )` | `this` | Replace all polygons 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 polygon.
`openPopup()` | `this` | Opens the popup previously bound by bindPopup.
`toGeoJSON()` | `Object` | Returns a GeoJSON representation of the multipolygon (GeoJSON MultiPolygon Feature).