我对发送请求所获得的航点顺序感到困惑。
起初我发了..
https://maps.googleapis.com/maps/api/directions/json?origin=New Delhi&destination = Chennai&waypoints = optimize:true | Agra | Bhopal | Nagpur | Vijaywada&key =“您的API密钥”
并得到Waypoint_order为: “ waypoint_order”:[ 0, 1, 2, 3 ]
以上对我有好处。 但, 然后,我混合了航路点,并发送了另一个请求,如下所示:
https://maps.googleapis.com/maps/api/directions/json?origin=New Delhi&destination = Chennai&waypoints = optimize:true | Vijaywada | Agra | Bhopal | Nagpur&key =“您的API密钥”
并获得Waypoint订单为: “ waypoint_order”:[ 1, 2, 3, 0 ]
可以,有人可以帮助我。.
答案 0 :(得分:1)
在您的第一个示例中:
您通过:Agra|Bhopal|Nagpur|Vijaywada
您会收到Waypoint_order 0,1,2,3
,即 Agra> Bhopal> Nagpur> Vijaywada
在第二个示例中:
您通过:Vijaywada|Agra|Bhopal|Nagpur
您会收到Waypoint_order 1,2,3,0
,即 Agra> Bhopal> Nagpur> Vijaywada
在两种情况下,API均返回相同的航点顺序。