Polyline
Generate a polyline object and display it on the map.
Polyline
Parameters
path
Each {lat, lng} behaves as a node
JSON Array
strokeColor
Specifies a hexadecimal HTML color of the format "#FFFFFF".
The Circle class does not support named colors.
The default is '#000000' specifies a hexadecimal HTML color of the format "#FFFFFF".
(Default : #000000)
Hex
strokeOpacity
Specifies a numerical value between 0.0 and 1.0 to determine the opacity of the line's color.
(Default : 1.0)
Numeric
strokeWeight
Specifies the width of the line in pixels.
(Default : 1)
String
message (popup)
Set the message of popup, type is string or HTML
String / HTML
event
Popup mouse event click or mouseover.
(Default : click)
String
anchor (popup)
A string indicating the part of the Marker that should be positioned closest to the coordinate set via Marker #setLngLat.
Options are 'center' , 'top' , 'bottom' , 'left' , 'right'.
(Default : bottom)
String
offset
(popup)
The offset in pixels as a PointLike object to apply relative to the element's center. Negatives indicate left and up. (Default : 15)
Numeric
closeButton (popup)
If true, a close button will appear in the top right corner of the popup.
(Default : false)
Boolean
coloseOnClick (popup)
If true, the popup closes when the map is clicked.
(Default : false)
Boolean
callback
A callback is a function passed as an argument to another function.
Function
Returns
Example
setMap
Parameters
null
Clear or destroy to generated polyline.
null
Returns
Example
addPolyline
Parameters
path
The shape of the polyline can be changed by setting new coordinates.
JSON Array
Returns
Example
setVisible
Parameter
modeShow
Show or hide the generated polyline on the map.
Boolean
Returns
Example
Last updated