-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get address and city ? #44
Comments
Hi @atifaziz2, The suggestion that is returned to you in the |
Hi @Giners , {description: "Istanbul, Turkey", id: "f8837dbe3fd95c9dcd9519b75e8a39159c205c3d", matched_substrings: Array(1), place_id: "ChIJawhoAASnyhQR0LABvJj-zOE", reference: "ChIJawhoAASnyhQR0LABvJj-zOE", …}description: "Istanbul, Turkey"id: "f8837dbe3fd95c9dcd9519b75e8a39159c205c3d"matched_substrings: [{…}]place_id: "ChIJawhoAASnyhQR0LABvJj-zOE"reference: "ChIJawhoAASnyhQR0LABvJj-zOE"structured_formatting: {main_text: "Istanbul", main_text_matched_substrings: Array(1), secondary_text: "Turkey"}terms: (2) [{…}, {…}]types: (3) ["locality", "political", "geocode"]: can you please guide me how to get city and country from this response? |
Hey @atifaziz2, The responses returned are simply suggestions of places that a person might be searching for. The suggestion is contained in the What you need to do to get address, city, country code, etc., details from a suggestion is to take its place ID (contained in the Check out these docs:
Note that in the example it simply looks for the There is a demo file called |
This is a bit late but could be of use for anyone reading this: I used the following to get the various address details (this is the "core" code I used):
Please modify the |
Hi!
I am using mui-places-autocomplete, in a suggestion how i get address , postcode, city and country?
The text was updated successfully, but these errors were encountered: