Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Deweloperzy z Europejskiego Obszaru Gospodarczego (EOG)
Możesz określić, których elementów trasy chcesz unikać, np. opłat za przejazd lub autostrad, dodając do żądania modyfikatory trasy. Interfejs API próbuje wtedy podać trasę, która nie wymaga tych funkcji.
Użyj w prośbie właściwości routeModifiers typu RouteModifiers. Możesz określić avoidTolls, avoidHighways, avoidFerries i avoidIndoor.
Określenie modyfikatora trasy nie musi eliminować tras, które obejmują funkcję podlegającą ograniczeniom. Interfejs API używa modyfikatora, aby faworyzować bardziej korzystne trasy. Prośba o opcję unikania może nie zmienić trasy z kilku powodów. Na przykład jedyna trasa z miejsca wyjazdu do miejsca docelowego uniemożliwia uniknięcie autostrady lub promu. lub alternatywna trasa znacznie wydłuża czas podróży.
W przykładzie poniżej pokazujemy, jak ustawić modyfikatory trasy w treści żądania metody computeRoutes (REST). Możesz też określić tę opcję w metodzie ComputeRoutes (gRPC). W tym przykładzie określasz, że chcesz unikać dróg płatnych i autostrad:
[[["Ł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-10 UTC."],[[["\u003cp\u003eThe Routes API's Compute Route Matrix feature does not support avoiding route features.\u003c/p\u003e\n"],["\u003cp\u003eYou can request routes that avoid tolls, highways, ferries, and indoor travel using the \u003ccode\u003erouteModifiers\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eWhile route modifiers bias the results, they may not eliminate the specified features if alternatives are unavailable or significantly increase travel time.\u003c/p\u003e\n"],["\u003cp\u003eYou can specify route modifiers in both REST and gRPC requests, using the \u003ccode\u003eavoidTolls\u003c/code\u003e, \u003ccode\u003eavoidHighways\u003c/code\u003e, \u003ccode\u003eavoidFerries\u003c/code\u003e, and \u003ccode\u003eavoidIndoor\u003c/code\u003e fields within the \u003ccode\u003erouteModifiers\u003c/code\u003e property.\u003c/p\u003e\n"]]],["Route modifiers, set in the `routeModifiers` property of a request, allow users to express preferences for avoiding tolls, highways, ferries, or indoor routes. The `Compute Route Matrix` feature does not support avoiding route features. Modifiers bias the route calculation, but do not guarantee avoidance. `routeModifiers` also supports `vehicleInfo` and `tollPasses`. The API might include the feature to be avoided if no practical alternative exists. An example in a `computeRoutes` request demonstrates setting `avoidTolls` and `avoidHighways` to `true`.\n"],null,[]]