【发布时间】:2015-12-14 12:32:55
【问题描述】:
我正在使用来自 Ruby 的 Google Direction Service。
我有这个对象:
params = {
origin: "37.88818,-4.77938",
destination: "36.51903,-6.28014",
waypoints: [
{
location:"Malaga",
stopover:false
}]
}
当我生成 url 时一切正常:
uri = URI('http://maps.googleapis.com/maps/api/directions/json')
uri.query = URI.encode_www_form(params)
但是当我使用 (lat,lng) 代替地名时,它会返回错误。
params = {
origin: "37.88818,-4.77938",
destination: "36.51903,-6.28014",
waypoints: [
{
location:"36.72126,-4.42127",
stopover:false
}]
}
如何使用 (lat,lng) 格式定义航点作为起点和终点?
【问题讨论】:
标签: ruby routes google-directions-api