Polyline

Draw a polyline on the map.

Parameters

NameDescriptiondefault
pathrequired The coordinates of the polyline, either an array or 2-D arrays/
maprequired The map instance to which the marker attaches to/
strokeColoroptional The stroke color of the polyline'#3388ff'
strokeOpacityoptional number The opacity of the polyline, in the middle of 0-11.0
strokeWeightoptional number The stroke weight of the polyline3
fillColoroptional string The fill color of the polyline'#3388ff'
fillOpacityoptional number The fill opacity of the polyline0.2
filloptional string Whether to fill the path with colorfalse

Methods

NameDescription
enableEditTo enable editing mode to the shape.

(Not available for Next Billion Maps GL)
removeTo remove the shape from the map

Example

var polyline = new nextbillion.maps.Polyline({
path: loc,
map: map,
color: 'red',
})
// To enable editing mode
// The method "enableEdit" is not available for Next Billion Maps GL
polyline.enableEdit()
// To remove from the map
polyline.remove()