I need restrict map area to 5km radius around given point. How can I get appropriate bounding box using mapbox-gl-js or turf?
I need restrict map area to 5km radius around given point. How can I get appropriate bounding box using mapbox-gl-js or turf?
Buffer API has changed. Buffer's optional argument needs to be an object like so:
var point = turf.point([-90.548630, 14.616599]);
var buffered = turf.buffer(point, 5, {units:'kilometers'}); /// notice 'units'
var bbox = turf.bbox(buffered);
console.log(turf.bboxPolygon(bbox));