Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Podczas obliczania macierzy tras warto wziąć pod uwagę opłaty za przejazd po trasach zawartych w niej. W wybranych miastach możesz obliczyć szacunkowy koszt opłat drogowych dla danej trasy w odpowiedniej walucie.
Listę obsługiwanych lokalizacji znajdziesz w dokumentacji TollPass.
Przykład opłat w ramach macierzy tras
W tym przykładzie metoda computeRouteMatrix zwraca informacje o opłatach drogowych na trasie z szacowaną ceną, gdy używana jest karta do opłat drogowych:
Aby umożliwić obliczenie informacji o opłatach za przejazd, ustaw pole tablicy extraComputations na TOLLS.
Określ typ pojazdu i typ karty do opłat za przejazd, korzystając z pola routeModifiers w punktach pośrednich origin żądania. Zwrócona cena za przejazd autostradą jest ustalana na podstawie cen stosowanych w przypadku określonego typu pojazdu i winiety. Jeśli zostanie określony więcej niż 1 bilet, zwracana jest cena najtańsza.
Aby skonfigurować metodę zwracania informacji o opłatach w odpowiedzi, użyj maski pola odpowiedzi. Podaj routes.travelAdvisory.tollInfo, aby uzyskać informacje o całej trasie.
Prośba o informacje o opłatach drogowych w ramach 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-05-13 UTC."],[[["The Routes API's `computeRouteMatrix` method allows you to calculate estimated toll fees for routes in supported cities, providing cost insights for route planning."],["To enable toll calculations, specify `TOLLS` in the `extraComputations` field and provide vehicle and toll pass details in the `routeModifiers` field within the request."],["Toll 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."],["While the Route Matrix provides toll information, detailed route specifics are not included; for that, use the `Compute Routes` functionality with single origin and destination points."],["Be aware that requests including toll fee calculations are billed at a higher rate than standard route matrix requests."]]],["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"]]