Reputation: 71
I built in google maps into my app. If you zoom close enough you will see places (see screenshot)
https://i.sstatic.net/rYCWl.png
I need to get the place ID for those places (ie when a user taps on it), thought this would be straightforward but unfortunately I cannot find it.
It would be similar as the official google maps app, if you click a place, it will load all the place information.
Upvotes: 3
Views: 630
Reputation: 2216
i will come straight to the point . follow the steps as i say.
first on the onMapClickListener() you will get the latlng and we will use this to get a place id for that place.
use this url to get the place id . the url will return json data and you can check it on browser that this gives a place id for that place. then you have to parse it in your app accordingly . the url is as follows-
give it a try and let me know.
thank you
Upvotes: 1
Reputation: 1201
Have a look at the PlacePicker.
https://developers.google.com/places/android-api/placepicker
Upvotes: 0