Routes Preferred API 目前僅適用於特定客戶。如需瞭解詳情,請
聯絡銷售人員。
Waypoint
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
封裝路線點。路線控點會標記路線的起點和終點,並在路線沿途包含中繼停靠站。
JSON 表示法 |
{
"via": boolean,
"vehicleStopover": boolean,
"sideOfRoad": boolean,
// Union field location_type can be only one of the following:
"location": {
object (Location )
},
"placeId": 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」交通方式。
|
聯集欄位 location_type 。以不同方式表示地點。location_type 只能是下列其中一項: |
location |
object (Location )
使用地理座標指定的點,包括選用的標頭。
|
placeId |
string
與路標相關聯的 POI 地點 ID。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-29 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-29 (世界標準時間)。"],[[["\u003cp\u003eWaypoints define the start, end, and intermediate stops of a route.\u003c/p\u003e\n"],["\u003cp\u003eWaypoints can be specified using geographic coordinates or a Place ID.\u003c/p\u003e\n"],["\u003cp\u003eYou can customize waypoint behavior, like marking them as pass-through points or vehicle stops.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003evehicleStopover\u003c/code\u003e helps optimize routes for pickup/drop-off, avoiding unsuitable roads for vehicles.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003esideOfRoad\u003c/code\u003e field allows specifying a preference for the vehicle to stop at a particular side of the road.\u003c/p\u003e\n"]]],["Waypoints, marking route beginnings, ends, and intermediate stops, are defined by several fields. `via` determines if it's a stop or a milestone. `vehicleStopover` indicates suitability for vehicle stops (pickup/drop-off). `sideOfRoad` specifies a preferred side for the vehicle to stop. The location can be represented as either geographic coordinates (`location`) or by a Place ID (`placeId`). Waypoints can affect the `legs` array. Only `location` is applicable to `vehicleStopover`.\n"],null,[]]