【发布时间】:2016-09-15 12:41:33
【问题描述】:
我们有一个应用程序,用户可以在其中报告事件并希望允许按关键字进行搜索。 Google Places API(我尝试过附近的搜索、文本搜索和自动填充)只返回商家,但有时用户可能在住宅街道上。如何获取 Places 以返回居住地址?
我知道那里有数据,因为如果您在 Google 地图上搜索,或使用地理编码 API,您可以获得准确的地址。
示例(在伦敦随机选择一个点): https://maps.googleapis.com/maps/api/place/nearbysearch/json?&key=[YOUR_KEY]&radius=50000&location=51.611499,-0.026750&keyword=sinclair
返回
Sinclair Pharma, 1st Floor Whitfield Court, 30-32 Whitfield Street, London
Sinclair Pharmaceuticals Ltd, Godalming Business Centre, Woolsack Way, Godalming
Sinclair Hammelton Bromley, 23 High Street, Bromley
Sinclair & Rush Ltd, 20 / 20 Business Estate, Spectrum West, Saint Laurence Avenue, Maidstone
Sinclair Hammelton Petts Wood, 9 Fairway, Orpington
Sinclair Till Flooring Co Ltd, 793 Wandsworth Road, London
etc
但是
https://maps.googleapis.com/maps/api/geocode/json?&key=[YOUR_KEY]&latlng=51.611499,-0.026750
返回
148 Sinclair Rd, London E4 8PR, UK
【问题讨论】: