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