Sử dụng bộ hạn định dừng xe
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.
Bạn có thể sử dụng bộ hạn định Điểm dừng xe để chỉ định rằng một điểm trung gian được dùng để dừng xe để đón hoặc trả khách. Điều này đảm bảo rằng tuyến đường được tính toán sẽ 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 (ví dụ: đường cao tốc hoặc đường hầm).
Trường hợp sử dụng mẫu
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. Điều 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, bạn có thể đặt trường vehicleStopover
để đả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 (tức là trên đường mặt đất).
Ví dụ:
Ví dụ sau đây minh hoạ cách đặt bộ hạn định vehicleStopover
.
{
"vehicleStopover": true,
"location": {
"latLng": {
"latitude":37.419734,
"longitude":-122.0827784
}
}
}
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: 2024-11-23 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2024-11-23 UTC."],[[["\u003cp\u003eThe Vehicle Stop-over qualifier ensures routes start and end at locations suitable for pickups and drop-offs, avoiding unsuitable roads like highways or tunnels.\u003c/p\u003e\n"],["\u003cp\u003eBy setting \u003ccode\u003evehicleStopover\u003c/code\u003e to true for a waypoint, the calculated route will prioritize accessible roads for pickup and drop-off points.\u003c/p\u003e\n"],["\u003cp\u003eThis feature is particularly useful when a waypoint is located near restricted areas like tunnels, ensuring the route directs to a safe and accessible nearby road.\u003c/p\u003e\n"]]],["The `vehicleStopover` qualifier designates a waypoint for pick-up or drop-off. Setting `vehicleStopover` to `true` ensures the route begins or ends on a suitable road, avoiding unsuitable locations like highways or tunnels. Without this, a waypoint at an intersection (e.g., surface road over a tunnel) could lead to a route beginning or ending in the tunnel. The example demonstrates setting `vehicleStopover` to `true` within a waypoint's definition.\n"],null,["# Use the Vehicle Stop-over Qualifier\n\nYou can use the Vehicle Stop-over qualifier to specify that a waypoint is meant\nto be used for stopping for picking-up or dropping-off. This ensures that the\ncalculated route won't begin or end on a road that is unsuitable for pickup and\ndrop-off (for example, a highway or tunnel).\n\nExample use case\n----------------\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 presents a problem because you can't stop in tunnels to\nmake pickups or drop-offs.\n\nIf you want to use the waypoint for a pickup or drop-off, then you could set the\n`vehicleStopover` field, which ensures that the resulting route begins or ends\non a road that allows pickups and drop-offs (that is, on the surface road).\n\nExample\n-------\n\nThe following example demonstrates how to set the\n[`vehicleStopover`](/maps/documentation/routes_preferred/reference/rest/v1alpha/TopLevel/computeRoutes#Waypoint.FIELDS.vehicle_stopover) qualifier. \n\n```cplint\n{\n \"vehicleStopover\": true,\n \"location\": {\n \"latLng\": {\n \"latitude\":37.419734,\n \"longitude\":-122.0827784\n }\n }\n}\n```"]]