如何使用Google Places API搜索特定类型的地点? [英] How can I search places with specific types using Google Places API?
问题描述
我正在使用google地方api来搜索特定类型,如(gas_station,咖啡馆,shopping_malls等...),这里是我使用 https://maps.googleapis.com/maps/api的链接/place/search/json?location=41.104805,29.024291&radius=50000&types=gas_station&sensor=false&key=AIzaSyAhVKOOLN1lx6iKKnbXMT82W1cKG7O8cDY
所以在这里我需要搜索附近的所有gas_stations我的位置,所以在这里我得到
results:[],
status:ZERO_RESULTS
但是在我的位置有一些gas_stations在那里),所以我怎么能得到这些结果可以任何一个帮助我..
感谢您的预先。
问题在于数据的分类。如果您搜索 types = university
,您会看到许多结果。现在看看这些结果中的类型
- 它们大多被列为 [university,establishment]
。
该地区的所有加油站只被分类为 [建立]
,所以他们'不要在搜索 gas_station
时出现。
您可以使用关键字
搜索以在其元数据中返回具有gas%20station的商家。它似乎与在Google地图中搜索该地区周围的加油站相同的结果。
I am using google place api to search specific types like(gas_station,cafes,shopping_malls etc...) here is link i am using https://maps.googleapis.com/maps/api/place/search/json?location=41.104805,29.024291&radius=50000&types=gas_station&sensor=false&key=AIzaSyAhVKOOLN1lx6iKKnbXMT82W1cKG7O8cDY
so here i need to search all gas_stations nearby my location so here i get "
results" : [],
"status" : "ZERO_RESULTS"
But in my location some gas_stations are there(i search google map) so how can i get these results can any one help me..
Thanks for advance.
The problem is with the categorization of the data. If you do a search for types=university
you'll see a number of results. Now look at the types
in those results - they're listed mostly as ["university", "establishment"]
.
All of the gas stations in the area are only categorized as ["establishment"]
, so they're not coming up in your search for gas_station
.
You could use the keyword
search to return businesses with "gas%20station" in their metadata. It seems to return the same results as searching for "gas station" around that area in Google Maps.
这篇关于如何使用Google Places API搜索特定类型的地点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!