Repository navigation
feat: vehicle, avoid-point, waypoint and time options for requestRoutes - #25
Merged
Merged
Conversation
mfazekas
force-pushed
the
feat/route-request-options
branch
from
October 29, 2026 05:45
4934aaf to
d5d7e75
Compare
mfazekas
marked this pull request as ready for review
October 29, 2026 07:00
Adds maxHeight, maxWidth, maxWeight, excludePoints, departAt and arriveBy to RouteRequestOptions, and silent and approach to waypoints. Android now gets the request as one map, like the dictionary iOS gets, instead of positional JNI arguments.
mfazekas
force-pushed
the
feat/route-request-options
branch
from
October 29, 2026 07:47
d5d7e75 to
c3d27de
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the most requested Directions options to
requestRoutes: vehicle dimensions (maxHeight,maxWidth,maxWeight), avoid points (excludePoints, sent together withexcludein the same Directions parameter),departAt/arriveBy, and per-waypointsilent(via points that don't split legs) andapproach: 'curb'.Android now gets the request as one
HashMapthat mirrors the dictionary iOS already gets, so new fields no longer change the JNI signature. Options the profile doesn't support, values out of range and a silent origin or destination now reject in JS withcode: 'invalid_options'. Without that check the API ignores some of them, iOS drops others and Android sends them, so the platforms would behave differently.departAt/arriveByareYYYY-MM-DDThh:mmstrings in local time at the origin/destination rather thanDates, because the iOS SDK always formats dates that way (in UTC, with no offset), so an absolute time can't be passed through. iOS avoid points use the SDK's@_spi(ExperimentalMapboxAPI)excludedLocations.I tested each option on an iOS simulator and an Android emulator, comparing routes with and without it in Boston. Kenmore to MGH uses Storrow Drive by default. With
maxHeight: 3.5, or an avoid point on Storrow, it takes Mass Ave and MA 3 instead (2814 m → 3500 m).maxWeight: 30reroutes via Boylston Street. A silent via point gives 1 leg instead of 2.approach: 'curb'gives 1163 m → 1901 m.departAtat 03:00 vs 17:30 gives 762 s vs 1387 s. Both platforms returned the same routes as the Directions API called directly.maxWidth: 3didn't change the route there.