如何使用Google Places API获取具有特定类型的地点?

时间:2011-12-23 05:27:52

标签: google-maps-api-3 geocode

我需要使用Google Places Api的所有类型的cafe,gas_station和restaurant。这是我通过API的查询:

https://maps.googleapis.com/maps/api/place/search/json?location=41.104805,29.024291&radius=50000&sensor=true&key=AIzaSyAVH0qHD6BPxRlnck3rIqcxC5TTwOTyfds&types=gas_station||shopping_mall

仅返回清真寺位置类型。我没有购买shopping_mall,gas_station或餐馆类型。在这里我正在检查google place api中的类型

我如何获得所有这些类型?

3 个答案:

答案 0 :(得分:2)

不幸的是,Google Places API似乎在该区域的这些类别下没有任何内容。

使用types=establishment获取该领域更完整的商家列表等。

不幸的是,您必须找到一些其他方法来确定什么是加油站等。至少在目前,Google Places API似乎没有这些数据。

有可能自己提供这些数据。

答案 1 :(得分:2)

自上述答案发布以来,Google已添加对其他地理位置类型的支持。

https://developers.google.com/places/documentation/supported_types

答案 2 :(得分:0)

在其他SO帖子中建议您在查询中使用“关键字”代替“类型”给Google。相关SO线程: How can I search places with specific types using Google Places API?