-1

I have a group of locations on a map-box map that i want to surround with a circle that covers all points - with a padding / border / buffer if possible.

Using buffer (turfjs) i can get an area around each point, using the convex/concave i can get a shape to cover all points and with the transformScale i can add a padding/buffer. But would ideally have a circle vs a polygon shape.

RyanMnM
  • 9
  • 2

1 Answers1

1

One thing you could try is getting the centroid of all the points that you want to draw the circle around, and then use that centroid/point with turf.circle (docs) to create the circle around all of the points. You could get the distance from the centroid to the furthest point from it to use as the radius to ensure the circle contains all necessary points. If you want it to look "more round", use higher a higher step value when calling turf.circle.

Dylan Hamilton
  • 662
  • 4
  • 14