wellyshen / use-places-autocomplete

๐Ÿ˜Ž ๐Ÿ“ React hook for Google Maps Places Autocomplete.

Home Page:https://use-places-autocomplete.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Docs] Usage of requestOptions - how to get country/city etc in the suggestion

ScottAgirs opened this issue ยท comments

Thank you for the awesome package!

I skimmed through the docs [1, 2, and 3] I'm still a bit confused as per how to request the types in order to retrieve the country, city etc in the returned suggestions.

So the question/suggestion/request:

It would be very helpful if the docs would include at least one basic example of how to use requestOptions instead of just having a placeholder /* Define search scope here */

PS.
And in case my gut feels is right and the requestOptions are not at all meant to alter the response for the formatting, then perhaps any pointers on how one could go about this? But would still be nice to have an example that explains the purpose of requestOptions in more detail. :)

Thanks again for this package! ๐Ÿ™Œ๐Ÿผ

Sources:
https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service#AutocompletionRequest
https://developers.google.com/places/supported_types#table3

@ScottAgirs Maybe you are looking for the getDetails utility function.