Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Deweloperzy z Europejskiego Obszaru Gospodarczego (EOG)
Obliczając macierz tras, możesz wziąć pod uwagę opłaty za przejazd drogami płatnymi na trasach w macierzy. W przypadku wybranych miast możesz obliczyć szacunkową opłatę za przejazd w odpowiedniej walucie.
Listę obsługiwanych lokalizacji, w których pobierane są opłaty za przejazd, znajdziesz w dokumentacji TollPass.
Przykład opłat za przejazd w macierzy tras
W tym przykładzie używamy metody computeRouteMatrix, aby zwrócić informacje o opłatach na trasie z szacunkową ceną, gdy używana jest karta opłat:
Ustaw pole tablicy extraComputations na TOLLS, aby włączyć obliczanie informacji o opłatach za przejazd.
Określ typ pojazdu i rodzaj winiety, używając pola routeModifiers punktów trasy origin w żądaniu. Zwracana cena winiety jest obliczana na podstawie cen stosowanych w przypadku określonego typu pojazdu i winiety. Jeśli określono więcej niż 1 rodzaj karnetu, zwracana jest najniższa cena.
Użyj maski pola odpowiedzi, aby skonfigurować metodę zwracania informacji o opłatach w odpowiedzi. Określ
routes.travelAdvisory.tollInfo, aby zwrócić informacje o całej trasie.
Prośba o informacje o opłatach za przejazd w macierzy tras
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 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,[]]