简体   繁体   中英

How can I get the nearby locations without giving type in url?

I am using the Google places api and it is working fine. I want to show the nearby places, for that I have given type as a restaurant in api url:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=12.916263577001692,77.65223027601557&radius=1500&types=restaurant&sensor=true&key=MYWORKINGKEY

The situation arises where I can't make a call to api for each type. Is there any common keyword to get nearby places?

In google places api the "types" is an optional parameter. if u set the type it restricts the results to Places matching to that type only.

just remove the type parameter and see the result.

https://maps.googleapis.com/maps/api/place/nearbysearch/json
location=12.916263577001692,77.65223027601557&radius=1500&sensor=true&key=MYWORKINGKEY

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM