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)
Khi tính toán ma trận tuyến đường, bạn có thể muốn xem xét mọi khoản phí cầu đường trên các tuyến đường trong ma trận. Đối với một số thành phố, bạn có thể tính phí cầu đường ước tính cho một tuyến đường bằng đơn vị tiền tệ phù hợp.
Để biết danh sách các vị trí có thu phí được hỗ trợ, hãy xem thông tin tham khảo về TollPass.
Ví dụ về phí cầu đường trong ma trận tuyến đường
Ví dụ sau đây sử dụng phương thức computeRouteMatrix để trả về thông tin về phí cầu đường trên một tuyến đường có mức giá ước tính khi sử dụng thẻ thu phí:
Đặt trường mảng extraComputations thành TOLLS để bật tính năng tính toán thông tin về phí cầu đường.
Chỉ định loại xe và loại thẻ thu phí bằng cách sử dụng trường routeModifiers của các điểm tham chiếu origin trong yêu cầu. Giá cầu đường được trả về dựa trên mức giá mà loại xe và thẻ đã chỉ định sử dụng. Nếu bạn chỉ định nhiều thẻ và vé, thì giá rẻ nhất sẽ được trả về.
Sử dụng mặt nạ trường phản hồi để định cấu hình phương thức trả về thông tin về phí cầu đường trong phản hồi. Chỉ định routes.travelAdvisory.tollInfo để trả về thông tin cho toàn bộ tuyến đường.
Yêu cầu thông tin về phí cầu đường của ma trận tuyến đường
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-09-04 UTC."],[[["\u003cp\u003eThe Routes API's \u003ccode\u003ecomputeRouteMatrix\u003c/code\u003e method allows you to calculate estimated toll fees for routes in supported cities, providing cost insights for route planning.\u003c/p\u003e\n"],["\u003cp\u003eTo enable toll calculations, specify \u003ccode\u003eTOLLS\u003c/code\u003e in the \u003ccode\u003eextraComputations\u003c/code\u003e field and provide vehicle and toll pass details in the \u003ccode\u003erouteModifiers\u003c/code\u003e field within the request.\u003c/p\u003e\n"],["\u003cp\u003eToll prices are estimates and are influenced by factors like vehicle type and toll pass used, with the response including the estimated price in the specified currency.\u003c/p\u003e\n"],["\u003cp\u003eWhile the Route Matrix provides toll information, detailed route specifics are not included; for that, use the \u003ccode\u003eCompute Routes\u003c/code\u003e functionality with single origin and destination points.\u003c/p\u003e\n"],["\u003cp\u003eBe aware that requests including toll fee calculations are billed at a higher rate than standard route matrix requests.\u003c/p\u003e\n"]]],["To calculate toll fees for a route matrix, set the `extraComputations` field to `TOLLS`. Specify the vehicle type and toll pass using the `routeModifiers` field within the origin waypoints; the lowest-cost toll pass pricing will be applied if multiple passes are set. Use the response field mask with `routes.travelAdvisory.tollInfo` to include toll information, and note that toll fee requests have a higher billing rate. The response then contains `estimatedPrice`.\n"],null,[]]