在不使用中心点和半径的情况下将所有咖啡馆放在特定区域

时间:2017-11-25 17:30:59

标签: google-api google-places-api google-places

我可以使用google apis从这个网址找到所定位区域内的所有咖啡馆:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=26.272514,50.195682&radius=15000&types=cafe&key=<myAPI>

上述范围内的区域位于以下圆圈内:

enter image description here

我考虑的城市的实际面积如下所示:

https://www.google.com.sa/maps/place/Al+Khobar/@26.2435009,50.0472298,11z/data=!4m5!3m4!1s0x3e49e839e8ef58d9:0xef778812d8b6aad1!8m2!3d26.2171906!4d50.1971381?hl=en

enter image description here

如何才能获得所有正好在这个城市的咖啡馆(不多也不少,不使用半径)?

1 个答案:

答案 0 :(得分:1)

在使用Google Places API here进行挖掘后,我发现此代码对我来说很合适:

https://maps.googleapis.com/maps/api/place/textsearch/json?query=cafes+in+Khobar&key=AIzaSyDAc91J9HvQ7bzyQqJzfQz38RcEjKamyEU