Get list of nearby places from Google Places API (

2019-02-10 00:11发布

问题:

I am aware that there are similar threats already, however, the exact topic I am looking for seems to not have been touched.

I am a programming newby, however, I achieved to get an app running, which fetches your current location, transforms the coordinates to an address and is able to store your location data in a tableView.

Now I am looking for a way on how to fetch a list of nearby stores with the help of the Google Places API and display them in a table view. I could only find plenty of help on how to display POIs on a map view, however, I would only like to display those in a list (e.g. "Walmart, 1st Avenue, 1234 Waltown).

Is some friendly stranger able to help me?

Thanks a lot in advance!

All the best from Germany, Jonas

回答1:

Here is an example url, where it returns a list of starbucks near your location.

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=(yourlatitude),(yourlongitude)&radius=5000&keyword=starbucks&key=(yourkey)

You can get the key from google console



回答2:

Check this out -->> https://www.raywenderlich.com/109888/google-maps-ios-sdk-tutorial

"Finding Something to Eat" section have what you needs.