无法使用Google Places API的表格#2类型 [英] Unable to use the table #2 types with Google Places API
问题描述
当我使用 types = transit_station | neighborhood (或表2中包含的任何其他类型: http://code.google.com/apis/maps/documentation/places/supported_types.html#table2显然,这与特定位置无关(我已经尝试过米兰,意大利和伦敦,GB),所以我想知道是否我做错了什么,或者如果API目前没有按预期工作。
如果上面没有解决方案,如果还有其他方法,我会很高兴寻找建筑物的邻居(例如,在这张地图上: http://g.co/maps/hfdke 我希望能够找到Fiera Campionaria,Il Portello等)。 你正在寻找的是次地区的,这可以通过地址自动填充API请求进行确认:
输入Fiera Campionaria返回类型为sublocality,political,geocode的Fiera Campionaria,Milano,Italia :
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Fiera%20Campionaria&sensor=false&key=your_api_key
输入Il Portello返回类型为sublocality,political,geocode的Il Portello,Milano,Italia:
https://maps.googleapis.com/maps/api/place/autocomplete/json? input = Il%20Portello& sensor = false& key = your_api_key
不幸的是,在此区域中的Places API Search请求中指定为sublocality | political |通用电器ocode不会返回以下结果:
https://maps.googleapis.com/maps/api/place/search/json?location=45.47536640,9.15523110&radius=3000& ; sensor = false& types = sublocality | political | geocode& key = your_api_key 我已经在内部报告了这个错误。
干杯
克里斯
I am unable to get any results with the Places API when I use a types=transit_station|neighborhood (or any other type included in the table 2 here: http://code.google.com/apis/maps/documentation/places/supported_types.html#table2
Apparently, this is not related to a specific location (I've tried both Milan, Italy and London, GB), so I'm wondering if I'm doing something wrong or if the API is not currently working as expected.
If the above has no solution, I'd be very happy if there was another way of finding the neighborhood of a building (for instance, in this map: http://g.co/maps/hfdke I'd like to be able to find "Fiera Campionaria", "Il Portello" etc).
What you are looking for are sublocality's, this can be confirmed through a Places Autocomplete API request:
Input "Fiera Campionaria" returns "Fiera Campionaria, Milano, Italia" with types "sublocality", "political", "geocode": https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Fiera%20Campionaria&sensor=false&key=your_api_key
Input "Il Portello" returns "Il Portello, Milano, Italia" with types "sublocality", "political", "geocode": https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Il%20Portello&sensor=false&key=your_api_key
Unfortunately a Places API Search request in this area with types specified as "sublocality|political|geocode" does not return these results: https://maps.googleapis.com/maps/api/place/search/json?location=45.47536640,9.15523110&radius=3000&sensor=false&types=sublocality|political|geocode&key=your_api_key
I have reported this Internally as a bug.
Cheers
Chris
这篇关于无法使用Google Places API的表格#2类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!