Legacy
Mapbox.js is no longer in active development. To learn more about our newer mapping tools see Mapbox GL JS.
You are viewing an older version of Mapbox.js. Check out v3.3.1 for the latest.
Circle
A class for drawing circle overlays on a map. Extends Path. Use Map#addLayer to add it to the map.
L.circle([50.5, 30.5], 200).addTo(map);
Creation
Factory | Description |
---|---|
L.circle(
|
Instantiates a circle object given a geographical point, a radius in meters and optionally an options object. |
Methods
Method | Returns | Description |
---|---|---|
getLatLng() |
LatLng |
Returns the current geographical position of the circle. |
getRadius() |
Number |
Returns the current radius of a circle. Units are in meters. |
setLatLng(
|
this |
Sets the position of a circle to a new location. |
setRadius(
|
this |
Sets the radius of a circle. Units are in meters. |
toGeoJSON() |
Object |
Returns a GeoJSON representation of the circle (GeoJSON Point Feature). |