Constructor and Description |
---|
PolyLine(LatLng[] latlngs)
Instantiates a polyline object given an array of geographical points.
|
PolyLine(LatLng[] latlngs,
PolyLineOptions options)
Instantiates a polyline object given an array of geographical points and an options object.
|
Modifier and Type | Method and Description |
---|---|
PolyLine |
addLatLng(LatLng latlng)
Adds a given point to the polyline.
|
PolyLine |
addTo(Map map)
Adds the layer to the map.
|
PolyLine |
bindPopup(Popup popup)
Binds a popup to a click on this polyline.
|
PolyLine |
bindPopup(Popup popup,
PopupOptions options)
Binds a popup with a particular popup configuration options to a click on
this polyline.
|
PolyLine |
bindPopup(String html)
Binds a popup with a particular HTML content to a click on this polyline.
|
PolyLine |
bringToBack()
Brings the layer to the bottom of all path layers.
|
PolyLine |
bringToFront()
Brings the layer to the top of all path layers.
|
PolyLine |
closePopup()
Closes the bound popup of the polyline if it's opened.
|
LatLng[] |
getLatLngs()
Returns an array of the points in the path.
|
PolyLine |
openPopup()
Opens the popup previously bound by the
bindPopup method. |
PolyLine |
redraw()
Redraws the layer.
|
PolyLine |
setLatLngs(LatLng[] latlngs)
Replaces all the points in the polyline with the given array of
geographical points.
|
PolyLine |
setStyle(PathOptions options)
Changes the appearance of a Path based on the options in the
PathOptions object. |
LatLng[] |
spliceLatLngs(int index,
int pointsToRemove,
LatLng... latlngs)
Allows adding, removing or replacing points in the polyline.
|
PolyLine |
unbindPopup()
Unbinds the popup previously bound to the polyline with
bindPopup . |
addEventListener, addMouseListener, addPopupListener, clearAllEventListeners, getBounds, removeEventListener, removeMouseListener, removePopupListener
public PolyLine(LatLng[] latlngs)
latlngs
- array of geographical pointspublic PolyLine(LatLng[] latlngs, PolyLineOptions options)
latlngs
- array of geographical pointsoptions
- configuration optionspublic PolyLine addLatLng(LatLng latlng)
latlng
- point to addpublic LatLng[] getLatLngs()
public PolyLine setLatLngs(LatLng[] latlngs)
latlngs
- array of points that replace the existing onespublic LatLng[] spliceLatLngs(int index, int pointsToRemove, LatLng... latlngs)
index
- index from that points should be inserted/removedpointsToRemove
- number of points to removelatlngs
- array of points to insertpublic PolyLine setStyle(PathOptions options)
PathOptions
object.public PolyLine bringToFront()
bringToFront
in class Path
public PolyLine bringToBack()
bringToBack
in class Path
public PolyLine redraw()
public PolyLine bindPopup(String html)
openPopup
method.public PolyLine bindPopup(Popup popup)
openPopup
method.public PolyLine bindPopup(Popup popup, PopupOptions options)
openPopup
method.public PolyLine unbindPopup()
bindPopup
.unbindPopup
in class Path
public PolyLine openPopup()
bindPopup
method.public PolyLine closePopup()
closePopup
in class Path
Copyright © 2017. All rights reserved.