我有一些关于 android 的谷歌地点 api 的问题。
这是正在调用的请求:
问题是我只想要特定城市内的地址。那可能吗?
这是引自
Google Places API autocomplete
这表明它应该起作用。
Blockquote the (regions) type collection instructs the Place service to return any result matching the following types:
Blockquote the (cities) type collection instructs the Place service to return results that match either locality or administrative_area3.
所以我想指定城市或邮政编码,以便仅过滤来自该城市的地址。
- 编辑 -
这种方法也行不通。
maps.googleapis.com/maps/api/place/autocomplete/json?sensor=false&key=API_KEY&types=geocode&location=45.811093,15.974121&radius=12000&components=country:hr&language=hr&input=lad
最佳答案
解决方案
我在输入字符串中添加了城市名称
city_name+street like Zagreb+fal 以便从萨格勒布获得所有名称中带有 fal* 的街道。
它似乎工作正常。
关于autocomplete - Google Places API 自动完成特定城市,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16517408/