Circle

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 circle on the map.

Parameters

NameDescriptiondefault
centerrequired The center coordinate of the circle/
maprequired The map instance to which the marker attaches to/
radiusoptional number The radius of the circle (meters)/
strokeColoroptional stringThe stroke color of the circle'#3388ff'
strokeOpacityoptional number The opacity of the circle, in the middle of 0-11.0
strokeWeightoptional number The stroke weight of the circle3
fillColoroptional string The fill color of the circle'#3388ff'
fillOpacityoptional number The fill opacity of the circle0.2
filloptional string Whether to fill the path with colorfalse

Methods

NameDescription
enableEditTo enable editing mode to the shape.

(Not available for NextBillion.ai Maps GL)
removeTo remove the shape from the map

Example

1
var circle = new nextbillion.maps.Circle({
2
center: { lat: 36.0671, lng: 120.3826 },
3
map: map,
4
radius: 600,
5
color: 'red',
6
})
7
8
// To enable editing mode
9
// The method "enableEdit" is not available for NextBillion.ai Maps GL
10
circle.enableEdit()
11
12
// To remove from the map
13
circle.remove()

© 2024 NextBillion.ai all rights reserved.