drawing circle with radius specified in meters on a map

Bala picture Bala · Jun 25, 2013 · Viewed 30.2k times · Source

Any pointers on how to draw a circle of radius, specified in meters, on top of a geographical map using D3 would be pretty helpful.

I tried to use Leaflet and it's Circle(or CircleMarker) that accepts radius in meters, but I need more flexibility to play with my data. D3 seems to be pretty helpful, but am not sure how to draw a circle of given radius on top of a map, such the circle covers an area corresponding to the given radius (and adapts to zoom and change in projection).

Answer

geraldarthur picture geraldarthur · Dec 9, 2013

You can pass these radii in meters using the latest version of Leaflet. The radius will change relative to zoom levels.

Here's some more information via Leaflet's documentation

L.circle([lat,lng], radius).addTo(map);