Skip to content

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

Note: This class is deprecated. It will be removed in the next major revision (v4). Please use the class 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).

Parameter Description Data type Default value
latlng [required] LatLng[][]
options [optional] Polygon options

Methods

setLatLngs(latlngs)

Replaces all polygons and their paths with the specified array of arrays of geographical points.

Parameter Description Data type Default value
latlngs LatLng[][]
  • Return: this

getLatLngs()

Returns an array of arrays with geographic points in each polygon.

  • Return: LatLng[][]

openPopup()

Opens the popup previously bound by bindPopup.

  • Return: this

toGeoJSON()

Returns a GeoJSON representation of the multipolygon (GeoJSON MultiPolygon Feature).

  • Return: object