Polyline
A newer version of Maps for web SDK is available
A newer version of the SDK is available and is recommended for all users. Learn about the latest version, V2.0, in the Maps for web v2.0 documentation
Draw a polyline on the map.
Parameters
Name | Description | default |
---|---|---|
path | required The coordinates of the polyline, either an array or 2-D arrays | / |
map | required The map instance to which the marker attaches to | / |
strokeColor | optional The stroke color of the polyline | '#3388ff' |
strokeOpacity | optional number The opacity of the polyline, in the middle of 0-1 | 1.0 |
strokeWeight | optional number The stroke weight of the polyline | 3 |
Methods
Name | Description |
---|---|
enableEdit | To enable editing mode to the shape. (Not available for NextBillion.ai Maps GL) |
remove | To remove the shape from the map |
Example
1var polyline = new nextbillion.maps.Polyline({
2 path: loc,
3 map: map,
4 color: 'red',
5})
6
7// To enable editing mode
8// The method "enableEdit" is not available for NextBillion.ai Maps GL
9polyline.enableEdit()
10
11// To remove from the map
12polyline.remove()
Polygon
Popup