【问题标题】:Google Maps API V3 - How to Get Optimal Roundtrip Route Through Arbitrary WaypointsGoogle Maps API V3 - 如何通过任意航点获得最佳往返路线
【发布时间】:2012-04-27 23:04:55
【问题描述】:

关于 Google Maps V3 API 航点有很多问题,但没有一个可以解决如何从一组任意航点获取最佳往返路线。基本上,称重点的顺序应由最佳路径决定,不一定由输入系统的顺序决定。有人知道这是否可能吗?

【问题讨论】:

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


    【解决方案1】:

    V3 API 中有一个“优化”选项。你试过了吗?

    optimizeWaypoints

    If set to true, the DirectionService will attempt to re-order the supplied 
    intermediate waypoints to minimize overall cost of the route. If waypoints 
    are optimized, inspect DirectionsRoute.waypoint_order in the response to 
    determine the new ordering.
    
    optimizeWaypoints (optional) specifies that the route using the supplied 
    waypoints may be optimized to provide the shortest possible route.
    

    https://developers.google.com/maps/documentation/javascript/reference 的第一段。

    第二个来自https://developers.google.com/maps/documentation/javascript/directions

    【讨论】:

    • 我没有注意到那个选项。谢谢!
    • 除了有限的航路点之外,有谁知道如何做到这一点?
    猜你喜欢
    • 1970-01-01
    • 2013-04-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-20
    • 1970-01-01
    相关资源
    最近更新 更多