Replies: 1 comment 12 replies
-
I figured out a workaround, but this technically is still unanswered. There is something funky going on with the requestOptions. I tried a few different options from google docs and none of them seem to work, and there are not any examples of working options that I can find in the docs for the package, just "options go here". It very well could be my syntax is wrong, but I can't find anything to go on. I basically built a workaround by then taking the geocode and rather than look for the lat/lon like in the example given, I grabbed the details, pulled out the address_components, and wrote a quick little algorithm to sort through and only allow the full addresses to used. I'm leaving this up in the case that the owner of this repo or someone else comes by with an actual solution. |
Beta Was this translation helpful? Give feedback.
-
From what I am understanding you can use requestOptions as a way to set parameters for the api call. Reading the Places docs it seems that I can restrict the search to a specific type. I would like ONLY specific addresses to be returned, meaning no establishments, just cities, etc. This would be done using types=address.
This is what I have in my autocomplete component:
} = usePlacesAutocomplete({ requestOptions: { types: "address" }, debounce: 300, });
This creates very unexpected results, for example if I type the number 3 in the box I get a list of results. If I type the number 8 I get zero results at all.
Is my code not correct here? or is there a bug somewhere?
Thank you a ton for the help.
@wellyshen
Beta Was this translation helpful? Give feedback.
All reactions