4
关于Google Maps V3 API路线点有许多问题,但没有解决如何从一组任意路点获得最佳往返路线的问题。基本上,衡量点的顺序应该由最佳路径决定,而不一定由馈入系统的顺序决定。有人知道这是否可能吗?Google Maps API V3 - 如何通过任意路点获得最佳往返路线
关于Google Maps V3 API路线点有许多问题,但没有解决如何从一组任意路点获得最佳往返路线的问题。基本上,衡量点的顺序应该由最佳路径决定,而不一定由馈入系统的顺序决定。有人知道这是否可能吗?Google Maps API V3 - 如何通过任意路点获得最佳往返路线
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/directions
我没有注意到这个选项。谢谢! – VinnyD 2012-04-28 17:55:47
有没有人知道如何做到这一点比有限的航点? – 2014-09-30 10:51:16