Waypoint
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Đóng gói một điểm tham chiếu. Điểm tham chiếu đánh dấu cả điểm bắt đầu và điểm cuối của một tuyến đường và bao gồm các điểm dừng trung gian dọc theo tuyến đường.
Biểu diễn dưới dạng 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 .
} |
Trường |
via |
boolean
Đánh dấu điểm tham chiếu này là một mốc quan trọng thay vì điểm dừng. Đối với mỗi điểm tham chiếu không qua trong yêu cầu, phản hồi sẽ thêm một mục nhập vào mảng legs để cung cấp thông tin chi tiết về các điểm dừng trên chặng đó của chuyến đi. Đặt giá trị này thành true khi bạn muốn tuyến đường đi qua điểm tham chiếu này mà không cần dừng lại. Các điểm tham chiếu không khiến mục nhập được thêm vào mảng legs , nhưng chúng sẽ định tuyến hành trình qua điểm tham chiếu. Bạn chỉ có thể đặt giá trị này trên các điểm tham chiếu là trung gian. Yêu cầu không thành công nếu bạn đặt trường này trên các điểm tham chiếu của thiết bị đầu cuối. Nếu bạn đặt ComputeRoutesRequest.optimize_waypoint_order thành true (đúng), thì không thể đặt trường này thành true; nếu không, yêu cầu sẽ không thành công.
|
vehicleStopover |
boolean
Cho biết điểm tham chiếu dành cho các phương tiện dừng lại khi bạn muốn đến lấy hàng hoặc trả xe. Khi bạn đặt giá trị này, tuyến đường đã tính toán sẽ không bao gồm các điểm tham chiếu không phải via trên những con đường không phù hợp để đón và trả xe. Lựa chọn này chỉ hoạt động cho các phương tiện đi lại DRIVE và TWO_WHEELER , và khi locationType là Location .
|
sideOfRoad |
boolean
Cho biết rằng vị trí của điểm tham chiếu này được dành cho xe cộ ưu tiên dừng ở một bên đường cụ thể. Khi bạn đặt giá trị này, tuyến đường sẽ đi qua vị trí này để xe có thể dừng ở bên đường mà vị trí lệch về phía giữa đường. Tuỳ chọn này chỉ hoạt động với DRIVE và TWO_WHEELER RouteTravelMode .
|
Trường kết hợp location_type . Các cách khác nhau để thể hiện một vị trí. location_type chỉ có thể là một trong những trạng thái sau đây: |
location |
object (Location )
Một điểm được chỉ định bằng toạ độ địa lý, bao gồm cả tiêu đề không bắt buộc.
|
placeId |
string
Mã địa điểm POI được liên kết với điểm tham chiếu.
|
address |
string
Địa chỉ mà con người có thể đọc được hoặc mã cộng. Xem https://plus.codes để biết chi tiết.
|
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-31 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-31 UTC."],[[["\u003cp\u003eWaypoints define the start, end, and intermediate points of a route.\u003c/p\u003e\n"],["\u003cp\u003eWaypoints can be specified using geographic coordinates, Place IDs, or addresses.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003evia\u003c/code\u003e field allows a waypoint to be a pass-through point without stopping.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003evehicleStopover\u003c/code\u003e is used for pickup/drop-off optimization, while \u003ccode\u003esideOfRoad\u003c/code\u003e indicates preferred stopping side.\u003c/p\u003e\n"]]],["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"],null,["# Waypoint\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n\nEncapsulates a waypoint. Waypoints mark both the beginning and end of a route, and include intermediate stops along the route.\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"via\": boolean, \"vehicleStopover\": boolean, \"sideOfRoad\": boolean, // Union field `location_type` can be only one of the following: \"location\": { object (/maps/documentation/routes/reference/rest/v2/Location) }, \"placeId\": string, \"address\": string // End of list of possible types for union field `location_type`. } ``` |\n\n| Fields ||\n|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `via` | `boolean` Marks this waypoint as a milestone rather a stopping point. For each non-via waypoint in the request, the response appends an entry to the [`legs`](/maps/documentation/routes/reference/rest/v2/TopLevel/computeRoutes#Route.FIELDS.legs) array to provide the details for stopovers on that leg of the trip. Set this value to true when you want the route to pass through this waypoint without stopping over. Via waypoints don't cause an entry to be added to the `legs` array, but they do route the journey through the waypoint. You can only set this value on waypoints that are intermediates. The request fails if you set this field on terminal waypoints. If `ComputeRoutesRequest.optimize_waypoint_order` is set to true then this field cannot be set to true; otherwise, the request fails. |\n| `vehicleStopover` | `boolean` Indicates that the waypoint is meant for vehicles to stop at, where the intention is to either pickup or drop-off. When you set this value, the calculated route won't include non-`via` waypoints on roads that are unsuitable for pickup and drop-off. This option works only for `DRIVE` and `TWO_WHEELER` travel modes, and when the `locationType` is [`Location`](/maps/documentation/routes/reference/rest/v2/Location). |\n| `sideOfRoad` | `boolean` Indicates that the location of this waypoint is meant to have a preference for the vehicle to stop at a particular side of road. When you set this value, the route will pass through the location so that the vehicle can stop at the side of road that the location is biased towards from the center of the road. This option works only for `DRIVE` and `TWO_WHEELER` [`RouteTravelMode`](/maps/documentation/routes/reference/rest/v2/RouteTravelMode). |\n| Union field `location_type`. Different ways to represent a location. `location_type` can be only one of the following: ||\n| `location` | `object (`[Location](/maps/documentation/routes/reference/rest/v2/Location)`)` A point specified using geographic coordinates, including an optional heading. |\n| `placeId` | `string` The POI Place ID associated with the waypoint. |\n| `address` | `string` Human readable address or a plus code. See \u003chttps://plus.codes\u003e for details. |"]]