Constructor and Description |
---|
Polygon(LatLng[] latlngs)
Instantiates a polygon object given an array of geographical points.
|
Polygon(LatLng[] latlngs,
PolyLineOptions options)
Instantiates a polygon object given an array of geographical points and an options object (the same as for Polyline).
|
Modifier and Type | Method and Description |
---|---|
Polygon |
addLatLng(LatLng latlng)
Adds a given point to the polygon.
|
Polygon |
addTo(Map map)
Adds the layer to the map.
|
Polygon |
bindPopup(Popup popup)
Binds a popup to a click on this polygon.
|
Polygon |
bindPopup(Popup popup,
PopupOptions options)
Binds a popup with a particular popup configuration options to a click on
this polygon.
|
Polygon |
bindPopup(String html)
Binds a popup with a particular HTML content to a click on this polygon.
|
Polygon |
bringToBack()
Brings the layer to the bottom of all path layers.
|
Polygon |
bringToFront()
Brings the layer to the top of all path layers.
|
Polygon |
closePopup()
Closes the bound popup of the polygon if it's opened.
|
Polygon |
openPopup()
Opens the popup previously bound by the
bindPopup method. |
Polygon |
redraw()
Redraws the layer.
|
Polygon |
setLatLngs(LatLng[] latlngs)
Replaces all the points in the polygon with the given array of geographical points.
|
Polygon |
setStyle(PathOptions options)
Changes the appearance of a Path based on the options in the
PathOptions object. |
Polygon |
unbindPopup()
Unbinds the popup previously bound to the polygon with
bindPopup . |
getLatLngs, spliceLatLngs
addEventListener, addMouseListener, addPopupListener, clearAllEventListeners, getBounds, removeEventListener, removeMouseListener, removePopupListener
public Polygon(LatLng[] latlngs)
latlngs
- Points of the polygon. Shouldn't contain an additional last point equal to the first one.public Polygon(LatLng[] latlngs, PolyLineOptions options)
latlngs
- Points of the polygon. Shouldn't contain an additional last point equal to the first one.options
- configuration optionspublic Polygon setLatLngs(LatLng[] latlngs)
setLatLngs
in class PolyLine
latlngs
- array of points that replace the existing onespublic Polygon setStyle(PathOptions options)
PathOptions
object.public Polygon bringToFront()
bringToFront
in class PolyLine
public Polygon bringToBack()
bringToBack
in class PolyLine
public Polygon redraw()
public Polygon bindPopup(String html)
openPopup
method.public Polygon bindPopup(Popup popup)
openPopup
method.public Polygon bindPopup(Popup popup, PopupOptions options)
openPopup
method.public Polygon unbindPopup()
bindPopup
.unbindPopup
in class PolyLine
public Polygon openPopup()
bindPopup
method.public Polygon closePopup()
closePopup
in class PolyLine
Copyright © 2017. All rights reserved.