how to calculate the coordinate points for the fitBounds()?

1k Views Asked by At

How do I calculate the coordinate points for the fitBounds() method to get the exact area in MapBox?

1

There are 1 best solutions below

0
On

To convert your coordinates to a bounding box you can use turf.bbox:

var featureBbox = turf.bbox(feature);