Firstly, I am using the mapRef to get the vanilla API for mapbox for use.
I am using turf.js to calculate the bbox from a polygon feature gotten when I draw a polygon on a layer using Mapbox Draw. After conversion, I use queryRenderedFeatures like so:
const features = drawRef && drawRef.getFeatures();
const geometry = features && features[0];
console.log(features);
const bbox = geometry && turf.bbox(features[0]);
console.log(
bbox && map.queryRenderedFeatures({ bbox, layers: ["mexs"] })
);
I constantly seem to get an empty array with the above code. However, when I replace the 'bbox' parameter with a point in the queryRenderedFeatures function, I get the layer properties. What am I doing wrong, please? Help me