具有优化路标的Google Maps API。 Waypoint_Order关闭

时间:2012-07-13 13:23:10

标签: javascript google-maps google-maps-api-3

我在某些请求中遇到了waypoint_order的问题,它与腿的最终位置匹配,有时则不匹配。以下是我如何发送请求以及航点和航段。

    var request = {
            origin: start,
            destination: end,
            waypoints: waypts,
            optimizeWaypoints: true,
            travelMode: google.maps.DirectionsTravelMode.DRIVING,
            unitSystem: google.maps.UnitSystem.IMPERIAL
        };

传递航点。

waypt [0] 1450 West Jackson Street Ozark密苏里州----订单[0] 3

waypt [1] 2825 S Glenstone Ave Springfield密苏里州----订单[1] 1

waypt [2] 404 West South Street Nixa Missouri ----订单[2] 0

waypt [3] 500 West Chestnut Expressway斯普林菲尔德密苏里州----订单[3] 4

waypt [4] 715 W. Mt. Vernon Nixa Missouri ----订单[4] 2

航点顺序:3,1,0,4,2

腿。

leg [0]来自1923年E Kearney St,Springfield,MO 65803,USA

leg [0] to 500 W Chestnut Expy,Springfield,MO 65806,USA

leg [1]来自500 W Chestnut Expy,Springfield,MO 65806,USA

leg [1] to 2825 S Glenstone Ave,Springfield,MO 65804,USA

leg [2]来自2825 S Glenstone Ave,Springfield,MO 65804,USA

leg [2] to 1450 W Jackson St,Ozark,MO 65721,USA

leg [3]来自1450 W Jackson St,Ozark,MO 65721,USA

leg [3] to 715 W Mt Vernon St,Nixa,MO 65714,USA

leg [4]来自715 W Mt Vernon St,Nixa,MO 65714,USA

leg [4] to 404 W South St,Nixa,MO 65714,USA

leg [5]来自404 W South St,Nixa,MO 65714,USA

leg [5] to 3315 S Campbell Ave,Springfield,MO 65807,USA

根据腿的航点顺序:[2,1,4,0​​,3]

有人知道为什么result.routes [0] .waypoint_order中的waypoint_order会关闭吗?

0 个答案:

没有答案