google.maps.Polyline class
A polyline is a linear overlay of connected line segments on the map.
This class extends MVCObject.
Constructor
Polyline([opts])
Parameters:
- opts: PolylineOptions optional
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()
Parameters: None
Return Value: boolean
Returns whether this shape can be dragged by the user.
getEditable()
Parameters: None
Return Value: boolean
Returns whether this shape can be edited by the user.
getMap()
Parameters: None
Return Value: Map
Returns the map on which this shape is attached.
getPath()
Parameters: None
Return Value: MVCArray<LatLng>
Retrieves the path.
getVisible()
Parameters: None
Return Value: boolean
Returns whether this poly is visible on the map.
setDraggable(draggable)
Parameters:
- draggable: boolean
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(editable)
Parameters:
- editable: boolean
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(map)
Parameters:
- map: Map
Return Value: None
Renders this shape on the specified map. If map is set to null, the shape will be removed.
setOptions(options)
Parameters:
- options: PolylineOptions
Return Value: None
setPath(path)
Parameters:
- path: MVCArray<LatLng>|Array<LatLng|LatLngLiteral>
Return Value: None
Sets the path. See PolylineOptions for more details.
setVisible(visible)
Parameters:
- visible: boolean
Return Value: None
Hides this poly if set to false.
Events
function(event)
Arguments:
- event: PolyMouseEvent
This event is fired when the DOM click event is fired on the Polyline.
function(event)
Arguments:
- event: PolyMouseEvent
This event is fired when the DOM dblclick event is fired on the Polyline.
function(event)
Arguments:
- event: MouseEvent
This event is repeatedly fired while the user drags the polyline.
function(event)
Arguments:
- event: MouseEvent
This event is fired when the user stops dragging the polyline.
function(event)
Arguments:
- event: MouseEvent
This event is fired when the user starts dragging the polyline.
function(event)
Arguments:
- event: PolyMouseEvent
This event is fired when the DOM mousedown event is fired on the Polyline.
function(event)
Arguments:
- event: PolyMouseEvent
This event is fired when the DOM mousemove event is fired on the Polyline.
function(event)
Arguments:
- event: PolyMouseEvent
This event is fired on Polyline mouseout.
function(event)
Arguments:
- event: PolyMouseEvent
This event is fired on Polyline mouseover.
function(event)
Arguments:
- event: PolyMouseEvent
This event is fired when the DOM mouseup event is fired on the Polyline.
function(event)
Arguments:
- event: PolyMouseEvent
This event is fired when the Polyline is right-clicked on.