谷歌地图的API只能返回城市? [英] Google Maps places API to only return cities?
问题描述
我尝试使用Google的地图API从其json请求中返回城市:
https://地图。 googleapis.com/maps/api/place/autocomplete/json?input=green%20lanes&types=geocode&sensor=false&types=regions&key=*API此处按键*
关键是& types = regions
,但它仍会返回所有结果。
例如,我正在寻找街道 Green Lanes
,而不是返回可能包含 Green的城市。
应该是
ZERO RESULTS, (区域)类型集合指示Place服务返回与以下类型匹配的任何结果:
locality
sublocality
postal_code
country
administrative_area1
administrative_area2
I am trying to use Google's map API to only return cities from their json request:
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=green%20lanes&types=geocode&sensor=false&types=regions&key=*API KEY HERE*
The key being &types=regions
but it still returns all results.
For example, I am searching for the street Green Lanes
and rather than returning cities that might contain Green Lanes
its returning the street in London as the top result.
should be
ZERO RESULTS, because regions does not search for street name:
the (regions) type collection instructs the Place service to return any result matching the following types: locality sublocality postal_code country administrative_area1 administrative_area2
这篇关于谷歌地图的API只能返回城市?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!