2017-06-13 28 views
0

我有一個旅遊網站,列出了每個城市的興趣點。所以我使用谷歌Places API所返回的興趣點是這樣的:是否可以從Google Places API響應中排除某些「類型」?

https://maps.googleapis.com/maps/api/place/search/json?location=45.8150108,15.981919&radius=10000&types=point_of_interest&hasNextPage=true&nextPage()=true&sensor=false&key=My_Key 

然而,除了POI返回其他類型是這樣的:

"types": [ 
    "travel_agency", 
    "real_estate_agency", 
    "lodging", 
    "point_of_interest", 
    "establishment" 
    ], 

導致返回的東西像酒店和辦公室而不僅僅是POI,是否有強制返回POI的方法?我嘗試使用type而不是types,但它仍然返回其他types

回答

0

目前,您無法從Places API搜索中排除某些類型。公共問題跟蹤器中有一項功能請求來添加此功能。

https://issuetracker.google.com/issues/35822993

您可以出演這個功能要求增加您的投票和訂閱進一步的通知。

請注意,終端https://maps.googleapis.com/maps/api/place/search/json沒有記錄。

有以下端點Places API searches

  • 最近搜索https://maps.googleapis.com/maps/api/place/nearbysearch/output?parameters
  • 雷達搜索https://maps.googleapis.com/maps/api/place/radarsearch/output?parameters
  • 文本搜索https://maps.googleapis.com/maps/api/place/textsearch/output?parameters

,您應該使用其中之一。此外,types參數在2016年2月已棄用:

https://developers.google.com/places/web-service/search#deprecation

相關問題