如何从google API获取地名,地点ID,经度和经度?

时间:2015-07-08 05:22:29

标签: ruby-on-rails-4 google-maps-api-3

我只想从谷歌API获取地名,地点ID,纬度和经度。我使用了以下API:

response = HTTParty.get(" https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=" + params [:place] [:latitude] +"," + params [:place [:longitude ] +"&安培; rankby =距离&安培;类型=食品与键= AIzaSyAD6Vgkz7vo-nZLZp-xeNoPchOr7RepWEU&安培;字段=结果&#34)


https://maps.googleapis.com/maps/api/place/radarsearch/json?location=18.488091,73.813820&radius=500&types=bar|night_club&key=AIzaSyAD6Vgkz7vo-nZLZp-xeNoPchOr7RepWEU

但两人都向我提供了很多信息。还有其他api给我上面提到的字段吗?

1 个答案:

答案 0 :(得分:0)

我建议您使用地理编码器和反向地理编码器而不是API。