Tuyến đường dành cho xe hai bánh
API Routes Preferred hỗ trợ 4 phương thức di chuyển:
- Lái xe
- Đi bộ
- Xe đạp
- Xe mô tô hai bánh
Xe hai bánh là xe cơ giới hai bánh (ví dụ: xe máy).
Chế độ đi bằng xe hai bánh khác với chế độ đi bằng xe đạp, đây là chế độ đi bằng sức người.
Chỉ định chế độ di chuyển bằng xe hai bánh
Khi gọi các API Routes Preferred, bạn sẽ sử dụng giá trị liệt kê RouteTravelMode
để chỉ định phương thức di chuyển.
Ví dụ:
Ví dụ sau đây minh hoạ cách đặt chế độ đi lại trong phần nội dung yêu cầu phương thức ComputeRoutes()
.
{
"origin":{
"location":{
"latLng":{
"latitude":37.419734,
"longitude":-122.0827784
}
}
},
"destination":{
"location":{
"latLng":{
"latitude":37.417670,
"longitude":-122.079595
}
}
},
"travelMode":"TWO_WHEELER"
}
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."],[[["Routes Preferred APIs support four travel modes: drive, walk, bicycle, and two-wheeler (motorcycles)."],["Two-wheeler travel mode is distinct from bicycle travel mode, catering to motorized two-wheeled vehicles instead of human-powered ones."],["When using Routes Preferred APIs, specify the desired travel mode using the `RouteTravelMode` enumeration value within the request."],["An example demonstrates how to set the `travelMode` to \"TWO_WHEELER\" within the `ComputeRoutes()` method request body, illustrating its practical application."]]],["The Routes Preferred APIs support four travel modes: Drive, Walk, Bicycle, and Two-wheeler, where Two-wheeler refers to motorized two-wheeled vehicles. To use a specific mode, utilize the `RouteTravelMode` enumeration in the API call. For example, to specify the two-wheeler mode in the `ComputeRoutes()` method request body, set the `\"travelMode\"` parameter to `\"TWO_WHEELER\"`. The two-wheeler mode is distinct from the bicycle mode, which is human-powered.\n"]]