How do I properly utilize the bbox option in Mapbox react gl geocoder?

29 Views Asked by At

i would like my geocoder research option to be more efficient so, let me explain each user on my website has an assigned region ( example 75 for paris ) and I want the first suggestions to be location in the region of the user .

First I used bbox options of mapbox react gl so that my geocoder only autocompletes location near the user department but it just doesnt work. For example when i write "Rue" first autocompletes sends me to Hauts-de-Seine when my departement location is 500 km away ( see picture 2 ).

I also tried using setproximity options it doesnt seem to work ( see my code below ).

So could you tell me where is my mistake ?

Furthermore, just in case you ask my department, and deparment coordinates are well defined, i checked on console.

Geocoder code in reactjs

Picture of geocoder

0

There are 0 best solutions below