設定沿途的停靠站
如要設定路線上的停靠點 (例如上車/下車地點),請將路線控點指定為停靠路線控點。如要執行這項操作,請使用路線控點的 vehicleStopover
屬性、路線控點 (REST) 或 路線控點 (gRPC)。這項設定可確保計算的路線不會從不利於上車和下車的道路 (例如高速公路或隧道) 開始或結束。
請考慮地面道路與隧道內道路交叉的情況。如果您指定位於兩條道路交會處的路線點 (如地圖所示),則產生的路線會從/至地面道路或隧道開始/結束。這會導致問題,因為您無法在隧道中停車接送乘客。
如果您想使用目的地點用於乘客上車或下車,請將 vehicleStopover
欄位設為 true
,確保產生的路線會在允許乘客上車或下車的道路上開始或結束。
以下範例說明如何設定 vehicleStopover
屬性:
{
"origin":{
"location":{
"latLng":{
"latitude": 37.419734,
"longitude": -122.0827784
}
},
"vehicleStopover": true
},
...
}
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-02-06 (世界標準時間)。
[null,null,["上次更新時間:2025-02-06 (世界標準時間)。"],[[["Use the `vehicleStopover` property to designate a waypoint as a stopover for pickups or drop-offs, ensuring the route avoids unsuitable roads like highways or tunnels."],["Requests utilizing the `vehicleStopover` property incur higher billing rates compared to standard route requests."],["Setting `vehicleStopover` to `true` guarantees the route starts or ends on a road suitable for pickups and drop-offs, avoiding issues with waypoints located near tunnels or highways."],["The `vehicleStopover` property is crucial for optimizing routes for vehicles that require specific pickup and drop-off locations."]]],[]]