我正在使用 Direction API 来显示源和目的地之间的路线。我像这样形成了 URL
它提供了“多条路线”,如下所示
`{"routes" :
[
{ }
{ }
{ }
]}`
但是当我在 URL 中添加路径点时
它给出了“单一路线”,如下所示
`{
"routes" :
[{
"legs" : [ { }, { } ]
}]
}`
我指定了靠近起始位置的航路点,但仍然只获得单一路线。
我的 URL 或其方向 API 性质是否有任何错误?
有人遇到过这个问题吗?
最佳答案
根据这个article
Generally, only one entry in the routes array is returned for directions lookups, though the Directions service may return several routes if you pass alternatives=true.
因此,如果您添加 alternatives=true
,并不能保证会获得一些替代路线
关于android - 指定航路点时,Direction API 仅返回一条路线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47748874/