Google API for Restaurants Places

use*_*432 5 google-places-api

我在理解Google Places API时遇到了问题.我正在构建一个带有附近功能的iPhone应用程序,允许用户找到位于用户GPS周围的餐馆.如何获取Google API?我是否必须有一个定制的,这是如何工作的?如果我还想为兴趣点创建API,我该怎么办?

Doc*_*awk 7

有一个用于搜索附近位置的Google Places API.文档位于:https://developers.google.com/places/documentation/search#PlaceSearchRequests

但我猜你已经发现了.如果您提出更具体的问题,我们可以提供更多帮助.


Imr*_*qvi 5

您可以使用 Google place API ,如果您只想显示特定类型的地方,例如在您的案例中的餐厅,您可以使用请求对象,如下面的代码所示

 var request = {
    location: pyrmont,
    type: ['restaurant']
  };

 infowindow = new google.maps.InfoWindow();
  places = new google.maps.places.PlacesService(map);
places.nearbySearch(request, callback);
Run Code Online (Sandbox Code Playgroud)

有关 google place API 中类型过滤的更多详细信息,您可以查看Google Developers 上链接。但是附近搜索只带一个类型参数,而且只有餐馆。如果您正在寻找公共餐饮场所,则不是食物,不是咖啡馆,而是 Google API 提供的餐厅。