Đặt điểm dừng dọc theo tuyến đường
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.
Nhà phát triển ở Khu vực kinh tế Châu Âu (EEA)
Để đặt điểm dừng dọc theo một tuyến đường, chẳng hạn như để đón hoặc trả khách, bạn chỉ định một điểm trung gian làm điểm trung gian dừng. Để làm việc này, hãy sử dụng thuộc tính vehicleStopover
của một điểm trung gian, Điểm trung gian (REST) hoặc Điểm trung gian (gRPC).
Chế độ cài đặt này đảm bảo rằng tuyến đường được tính toán không bắt đầu hoặc kết thúc trên một con đường không phù hợp để đón và trả khách, chẳng hạn như đường cao tốc hoặc đường hầm.
Hãy xem xét trường hợp một đường mặt đất cắt ngang một đường bên trong đường hầm.
Nếu bạn chỉ định một điểm trung gian nằm ở vị trí hai con đường giao nhau (như thấy trên bản đồ), thì tuyến đường thu được sẽ bắt đầu hoặc kết thúc trên đường mặt đất hoặc đường hầm. Kết quả này gây ra vấn đề vì bạn không thể dừng xe trong đường hầm để đón hoặc trả khách.
Nếu muốn sử dụng điểm trung gian để đón hoặc trả khách, hãy đặt trường vehicleStopover
thành true
để đảm bảo rằng tuyến đường thu được bắt đầu hoặc kết thúc trên một con đường cho phép đón và trả khách.
Ví dụ sau đây minh hoạ cách đặt thuộc tính vehicleStopover
:
{
"origin":{
"location":{
"latLng":{
"latitude": 37.419734,
"longitude": -122.0827784
}
},
"vehicleStopover": true
},
...
}
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-06-20 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-06-20 UTC."],[[["\u003cp\u003eUse the \u003ccode\u003evehicleStopover\u003c/code\u003e property to designate a waypoint as a stopover for pickups or drop-offs, ensuring the route avoids unsuitable roads like highways or tunnels.\u003c/p\u003e\n"],["\u003cp\u003eRequests utilizing the \u003ccode\u003evehicleStopover\u003c/code\u003e property incur higher billing rates compared to standard route requests.\u003c/p\u003e\n"],["\u003cp\u003eSetting \u003ccode\u003evehicleStopover\u003c/code\u003e to \u003ccode\u003etrue\u003c/code\u003e guarantees the route starts or ends on a road suitable for pickups and drop-offs, avoiding issues with waypoints located near tunnels or highways.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003evehicleStopover\u003c/code\u003e property is crucial for optimizing routes for vehicles that require specific pickup and drop-off locations.\u003c/p\u003e\n"]]],["To designate a waypoint for pickup or drop-off, set the `vehicleStopover` property to `true` within the Waypoint object. This ensures the route begins or ends on a suitable road, avoiding locations like highways or tunnels. Setting `vehicleStopover` prevents routes from starting/ending on unsuitable roads. The `vehicleStopover` property is set within the Waypoint's JSON structure. Using `vehicleStopover` incurs a higher billing rate.\n"],null,["# Set a stop along a route\n\n**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](/maps/comms/eea/faq).\n\nTo set a stop along a route, for example, for a pickup or dropoff, you designate\na waypoint as a stopover waypoint. To do this, use the `vehicleStopover`\nproperty of a waypoint,\n[Waypoint](/maps/documentation/routes/reference/rest/v2/Waypoint) (REST) or\n[Waypoint](/maps/documentation/routes/reference/rpc/google.maps.routing.v2#waypoint) (gRPC).\nThis setting ensures that the calculated route doesn't begin or end on a road\nthat is unsuitable for pickup and drop-off, such as a highway or tunnel.\n| **Caution:** Requests using `vehicleStopover` are billed at a higher rate. [Learn more about billing](/maps/documentation/routes/usage-and-billing) for Routes API.\n\nConsider the situation where a surface road crosses over a road inside a tunnel.\nIf you were to specify a waypoint located where the two roads intersect (as seen\non a map), then the resulting route would begin or end on either the surface\nroad or the tunnel. This result presents a problem because you can't stop in\ntunnels to make pickups or drop-offs.\n\nIf you want to use the waypoint for a pickup or drop-off, then you set the\n`vehicleStopover` field to `true` to ensure that the resulting route begins or\nends on a road that allows pickups and drop-offs.\n\nThe following example demonstrates how to set the\n[`vehicleStopover`](/maps/documentation/routes/reference/rest/v2/TopLevel/computeRoutes#Waypoint.FIELDS.vehicle_stopover)\nproperty: \n\n```text\n{\n \"origin\":{\n \"location\":{\n \"latLng\":{\n \"latitude\": 37.419734,\n \"longitude\": -122.0827784\n }\n },\n \"vehicleStopover\": true\n },\n ...\n}\n```"]]