public final class MultiPolygon extends FeatureGroup
FeatureGroup
to allow creating multi-polygons (single
layer that consists of several polygons that share styling/popup).Constructor and Description |
---|
MultiPolygon(LatLng[][] latlngs)
Instantiates a multi-polygon object given an array of latlngs arrays (one
for each individual polygon).
|
MultiPolygon(LatLng[][] latlngs,
PolyLineOptions options)
Instantiates a multi-polygon object given an array of latlngs arrays (one
for each individual polygon) and an options object.
|
Modifier and Type | Method and Description |
---|---|
MultiPolygon |
addLayer(ILayer layer)
Adds a given layer to the group.
|
MultiPolygon |
addTo(Map map)
Adds the group of layers to the map.
|
MultiPolygon |
bindPopup(String html)
Binds a popup with a particular HTML content to a click on this group.
|
MultiPolygon |
bindPopup(String html,
PopupOptions options)
Binds a popup with a particular HTML content and the given options to the
group.
|
MultiPolygon |
bringToBack()
Brings the layer to the bottom of all path layers.
|
MultiPolygon |
bringToFront()
Brings the layer to the top of all path layers.
|
MultiPolygon |
clearLayers()
Removes all the layers from the group.
|
LatLng[][] |
getLatLngs()
Returns an array of arrays of geographical points in each polygon.
|
MultiPolygon |
openPopup()
Opens the popup previously bound by
bindPopup . |
MultiPolygon |
removeLayer(ILayer layer)
Removes a given layer from the group.
|
MultiPolygon |
removeLayer(String layerId)
Removes a given layer of the given id from the group.
|
MultiPolygon |
setLatLngs(LatLng[][] latlngs)
Replace all polygons and their paths with the given array of arrays of
geographical points.
|
MultiPolygon |
setStyle(PathOptions options)
Changes the appearance of a FeatureGroup based on the options in the
PathOptions object. |
addLayerListener, addMouseListener, clearAllEventListeners, getBounds, removeLayerListener, removeMouseListener
getLayers, hasLayer
public MultiPolygon(LatLng[][] latlngs)
latlngs
- array of latlngs arrayspublic MultiPolygon(LatLng[][] latlngs, PolyLineOptions options)
latlngs
- array of latlngs arraysoptions
- configuration optionspublic MultiPolygon setLatLngs(LatLng[][] latlngs)
latlngs
- array of arrays of geographical pointspublic LatLng[][] getLatLngs()
public MultiPolygon openPopup()
bindPopup
.public MultiPolygon bindPopup(String html)
bindPopup
in class FeatureGroup
html
- poup HTML contentpublic MultiPolygon bindPopup(String html, PopupOptions options)
bindPopup
in class FeatureGroup
html
- poup HTML contentoptions
- popup configuration objectpublic MultiPolygon setStyle(PathOptions options)
PathOptions
object.setStyle
in class FeatureGroup
options
- path configuration optionspublic MultiPolygon bringToFront()
bringToFront
in class FeatureGroup
public MultiPolygon bringToBack()
bringToBack
in class FeatureGroup
public MultiPolygon addTo(Map map)
addTo
in class FeatureGroup
map
- The mappublic MultiPolygon addLayer(ILayer layer)
addLayer
in class FeatureGroup
layer
- The layer to addpublic MultiPolygon removeLayer(ILayer layer)
removeLayer
in class FeatureGroup
layer
- The layer to removepublic MultiPolygon removeLayer(String layerId)
removeLayer
in class FeatureGroup
layerId
- The layer id of the layer to removepublic MultiPolygon clearLayers()
clearLayers
in class FeatureGroup
Copyright © 2017. All rights reserved.