Waypoint
封裝路線控點。路線控點會標記路線的起點和終點,並在路線沿途包含中繼停靠站。
JSON 表示法 |
{
"via": boolean,
"vehicleStopover": boolean,
"sideOfRoad": boolean,
// Union field location_type can be only one of the following:
"location": {
object (Location )
},
"placeId": string,
"address": string
// End of list of possible types for union field location_type .
} |
欄位 |
via |
boolean
將這個路線控點標示為里程碑,而不是停靠點。對於要求中的每個非透過路線控點,回應會在 legs 陣列中附加一個項目,提供行程中該路段的停靠站詳細資料。如果您想讓路線經過這個路線點而不停靠,請將這個值設為 true。透過路線控點,系統不會將項目加入 legs 陣列,但會讓路線經過路線控點。您只能在為中繼的路線控點設定此值。如果您在終端路線控點設定這個欄位,要求就會失敗。如果將 ComputeRoutesRequest.optimize_waypoint_order 設為 true,則這個欄位無法設為 true;否則要求失敗。
|
vehicleStopover |
boolean
表示路線控點是供車輛停靠,主要目的是讓使用者在上車或下車。設定這個值後,如果不適合上車和下車的道路,計算的路線就不會包含非 via 路線控點。這個選項僅適用於 DRIVE 和 TWO_WHEELER 交通方式,以及 locationType 為 Location 的情況。
|
sideOfRoad |
boolean
表示這個路線控點的位置是用來指定車輛在特定側面停靠的位置。設定這個值後,路線就會通過位置,這樣車輛就能在道路側停靠,該位置是從道路中心偏離位置。這個選項僅適用於 DRIVE 和 TWO_WHEELER RouteTravelMode 。
|
聯集欄位 location_type 。以不同方式表示地點。location_type 只能是下列其中一項: |
location |
object (Location )
使用地理座標指定的點,包含選擇性的方向。
|
placeId |
string
與路線控點相關聯的搜尋點地點 ID。
|
address |
string
人類可讀的地址或 Plus Code。詳情請參閱 https://plus.codes。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-04-29 (世界標準時間)。
[null,null,["上次更新時間:2025-04-29 (世界標準時間)。"],[[["Waypoints define the start, end, and intermediate points of a route."],["Waypoints can be specified using geographic coordinates, Place IDs, or addresses."],["The `via` field allows a waypoint to be a pass-through point without stopping."],["`vehicleStopover` is used for pickup/drop-off optimization, while `sideOfRoad` indicates preferred stopping side."]]],["Waypoints, marking route start, end, and intermediate stops, are defined using a JSON format. Key properties include `via` (boolean) for non-stopping waypoints, `vehicleStopover` (boolean) for pickup/drop-off locations, and `sideOfRoad` (boolean) for preferred stopping side. A waypoint's `location_type` can be specified via geographic coordinates (`location`), a place ID (`placeId`), or a human-readable address (`address`). `via` cannot be true for terminal waypoints or if `optimize_waypoint_order` is true.\n"]]