public final class Rectangle extends Polygon
Constructor and Description |
---|
Rectangle(LatLngBounds bounds)
Instantiates a rectangle object with the given geographical bounds.
|
Rectangle(LatLngBounds bounds,
PolyLineOptions options)
Instantiates a rectangle object with the given geographical bounds and an options object.
|
Modifier and Type | Method and Description |
---|---|
Rectangle |
addLatLng(LatLng latlng)
Adds a given point to the rectangle.
|
Rectangle |
addTo(Map map)
Adds the layer to the map.
|
Rectangle |
bindPopup(Popup popup)
Binds a given popup object to the rectangle.
|
Rectangle |
bindPopup(Popup popup,
PopupOptions options)
Binds a given popup object with the given options to the rectangle.
|
Rectangle |
bindPopup(String html)
Binds a popup with a particular HTML content to a click on this
rectangle.
|
Rectangle |
bringToBack()
Brings the layer to the bottom of all path layers.
|
Rectangle |
bringToFront()
Brings the layer to the top of all path layers.
|
Rectangle |
closePopup()
Closes the rectangle's bound popup if it is opened.
|
Rectangle |
openPopup()
Opens the popup previously bound by the
bindPopup method. |
Rectangle |
redraw()
Redraws the layer.
|
Rectangle |
setBounds(LatLngBounds bounds)
Redraws the rectangle with the passed bounds.
|
Rectangle |
setLatLngs(LatLng[] latlngs)
Replaces all the points in the rectangle with the given array of
geographical points.
|
Rectangle |
setStyle(PathOptions options)
Changes the appearance of a Rectangle based on the options in the
PathOptions object. |
Rectangle |
unbindPopup()
Unbinds the popup previously bound to the rectangle with
bindPopup . |
getLatLngs, spliceLatLngs
addEventListener, addMouseListener, addPopupListener, clearAllEventListeners, getBounds, removeEventListener, removeMouseListener, removePopupListener
public Rectangle(LatLngBounds bounds)
bounds
- geographical boundspublic Rectangle(LatLngBounds bounds, PolyLineOptions options)
bounds
- geographical boundsoptions
- configuration optionspublic Rectangle setBounds(LatLngBounds bounds)
bounds
- bounds of the rectanglepublic Rectangle setLatLngs(LatLng[] latlngs)
setLatLngs
in class Polygon
latlngs
- array of points that replace the existing onespublic Rectangle setStyle(PathOptions options)
PathOptions
object.public Rectangle bringToFront()
bringToFront
in class Polygon
public Rectangle bringToBack()
bringToBack
in class Polygon
public Rectangle redraw()
public Rectangle bindPopup(String html)
public Rectangle bindPopup(Popup popup, PopupOptions options)
public Rectangle unbindPopup()
bindPopup
.unbindPopup
in class Polygon
public Rectangle openPopup()
bindPopup
method.public Rectangle closePopup()
closePopup
in class Polygon
Copyright © 2017. All rights reserved.