google.maps.Polyline
class
A polyline is a linear overlay of connected line segments on the map.
This class extends
MVCObject.
| Constructor | |
|---|---|
Polyline |
Polyline([opts])Parameters:
Create a polyline using the passed PolylineOptions, which specify both the path of the polyline and the stroke style to use when drawing the polyline. You may pass either an array of LatLngs or an MVCArray of LatLngs when constructing a polyline, though simple arrays are converted to MVCArrays within the polyline upon instantiation. |
| Methods | |
|---|---|
getDraggable |
getDraggable()Parameters: None
Return Value:
booleanReturns whether this shape can be dragged by the user. |
getEditable |
getEditable()Parameters: None
Return Value:
booleanReturns whether this shape can be edited by the user. |
getMap |
getMap()Parameters: None
Return Value:
MapReturns the map on which this shape is attached. |
getPath |
getPath()Parameters: None
Retrieves the path. |
getVisible |
getVisible()Parameters: None
Return Value:
booleanReturns whether this poly is visible on the map. |
setDraggable |
setDraggable(draggable)Parameters:
Return Value: None
If set to true, the user can drag this shape over the map. The geodesic property defines the mode of dragging. |
setEditable |
setEditable(editable)Parameters:
Return Value: None
If set to true, the user can edit this shape by dragging the control points shown at the vertices and on each segment. |
setMap |
setMap(map)Parameters:
Return Value: None
Renders this shape on the specified map. If map is set to null, the shape will be removed. |
setOptions |
setOptions(options)Parameters:
Return Value: None
|
setPath |
setPath(path)Parameters:
Return Value: None
Sets the path. See PolylineOptions for more details. |
setVisible |
setVisible(visible)Parameters:
Return Value: None
Hides this poly if set to false. |
| Events | |
|---|---|
click |
function(event)Arguments:
This event is fired when the DOM click event is fired on the Polyline. |
dblclick |
function(event)Arguments:
This event is fired when the DOM dblclick event is fired on the Polyline. |
drag |
function(event)Arguments:
This event is repeatedly fired while the user drags the polyline. |
dragend |
function(event)Arguments:
This event is fired when the user stops dragging the polyline. |
dragstart |
function(event)Arguments:
This event is fired when the user starts dragging the polyline. |
mousedown |
function(event)Arguments:
This event is fired when the DOM mousedown event is fired on the Polyline. |
mousemove |
function(event)Arguments:
This event is fired when the DOM mousemove event is fired on the Polyline. |
mouseout |
function(event)Arguments:
This event is fired on Polyline mouseout. |
mouseover |
function(event)Arguments:
This event is fired on Polyline mouseover. |
mouseup |
function(event)Arguments:
This event is fired when the DOM mouseup event is fired on the Polyline. |
rightclick |
function(event)Arguments:
This event is fired when the Polyline is right-clicked on. |