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 เพื่อระบุรายละเอียดสำหรับการแวะพักระหว่างการเดินทาง ตั้งค่านี้เป็น "จริง" เมื่อคุณต้องการให้เส้นทางผ่านจุดอ้างอิงนี้โดยไม่หยุด จุดอ้างอิงจะไม่ทำให้มีการเพิ่มรายการลงในอาร์เรย์ legs แต่จะกำหนดเส้นทางการเดินทางผ่านจุดอ้างอิง คุณจะตั้งค่านี้ได้ในจุดอ้างอิงที่เป็นตัวกลางเท่านั้น คำขอจะล้มเหลวหากคุณตั้งค่าช่องนี้ในจุดอ้างอิงเทอร์มินัล หากตั้งค่า ComputeRoutesRequest.optimize_waypoint_order เป็น "จริง" ฟิลด์นี้จะตั้งเป็น "จริง" ไม่ได้ มิฉะนั้นคำขอจะล้มเหลว
|
vehicleStopover |
boolean
บ่งบอกว่าการชี้ทางมีไว้สำหรับให้รถหยุดโดยที่ตั้งใจจะรับส่งหรือไปรับ เมื่อคุณกำหนดค่านี้ เส้นทางที่คำนวณจะไม่รวมจุดอ้างอิงที่ไม่ใช่ via บนถนนที่ไม่เหมาะสำหรับการรับและส่ง ตัวเลือกนี้จะใช้ได้เฉพาะกับรูปแบบการเดินทางDRIVE และTWO_WHEELER และเมื่อlocationType คือ Location
|
sideOfRoad |
boolean
บ่งบอกว่าตำแหน่งของการชี้ทางนี้หมายถึงการกำหนดให้รถหยุดที่ด้านใดของถนน เมื่อคุณกำหนดค่านี้ เส้นทางนี้จะผ่านตำแหน่งดังกล่าวเพื่อให้รถสามารถหยุดด้านข้างของถนนที่เอนเอียงไปทางตำแหน่งนั้นจากจุดกึ่งกลางของถนน ตัวเลือกนี้ใช้ได้กับ DRIVE และ TWO_WHEELER RouteTravelMode เท่านั้น
|
ช่องการรวม location_type วิธีต่างๆ ในการแสดงสถานที่ location_type ต้องเป็นค่าใดค่าหนึ่งต่อไปนี้ |
location |
object (Location )
จุดที่ระบุโดยใช้พิกัดทางภูมิศาสตร์ ซึ่งรวมถึงส่วนหัวซึ่งไม่บังคับ
|
placeId |
string
รหัสสถานที่ของจุดที่น่าสนใจที่เกี่ยวข้องกับการชี้ทาง
|
address |
string
ที่อยู่หรือโค้ด Plus ที่มนุษย์อ่านได้ ดูรายละเอียดได้ที่ https://plus.codes
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 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. |"]]