ym.modules.provider.MultiPolygon
Overview
Extends FeatureGroup
to allow the creation of multi-polygons (a layer consisting of several polygons that share styling and popup).
This class is deprecated. It will be removed in the next major revision (v4). Please use the class Polygon Polygon
instead.
Initialization
Factory: ym.multiPolygon(latlng, options)
Instantiates a multi-polygon object with an array of latlngs arrays (one for each individual polygon) and optionally an option object (the same as MultiPolyline).
Parameters
Name | Description | Data type | Default value |
---|---|---|---|
latlng |
[required] | LatLng[][] |
|
options |
[optional] | Polygon options |
Methods
MultiPolygon accepts all polyline methods, but shows a different behaviour towards coordinate contents:
setLatLngs(latlngs) from v3
Replace all polygons and their paths with the specified array of arrays of geographical points.
Parameter
Name | Description | Data type | Default value |
---|---|---|---|
latlngs |
LatLng[][] |
Return
this
getLatLngs() from v3
Returns an array of arrays with geographic points in each polygon.
Return
LatLng[][]
openPopup() from v3
Opens the popup previously bound by bindPopup.
Return
this
toGeoJSON() from v3
Returns a GeoJSON representation of the multipolygon (GeoJSON MultiPolygon Feature)
Return
object