DEV Community

Rahul kumar
Rahul kumar

Posted on

Answer: Drawing a circle with the radius in miles/meters with Mapbox GL JS

Although all answers are complicated, here is the simplest answer

docs

var center = [84.82512804700335, 26.241818082937552];
var radius = 5;
var options = {steps: 50, units: 'kilometers', properties: {foo: 'bar'}};
var circle = turf.circle(center, radius, options);

DEMO LINK

result

enter image description here

Top comments (0)