Context
The core MapViewDirections component (#7) covers origin → destination routing. react-native-maps-directions also supports advanced Google Directions options that many production apps rely on: multi-stop routes, travel modes, traffic-aware ETAs, waypoint optimization, and automatic route splitting when waypoint limits are exceeded.
Reference props: https://github.com/bramus/react-native-maps-directions#props
Goal
Reach feature parity with react-native-maps-directions advanced routing props:
<MapViewDirections
origin={origin}
destination={destination}
waypoints={stops}
mode="DRIVING"
language="pl"
optimizeWaypoints
splitWaypoints
timePrecision="now"
precision="high"
resetOnChange={false}
apiKey={GOOGLE_MAPS_APIKEY}
/>
Scope
- Waypoints —
waypoints?: (Coordinate | string)[] between origin and destination.
- Travel mode —
mode?: 'DRIVING' | 'BICYCLING' | 'WALKING' | 'TRANSIT' (default 'DRIVING').
- Language —
language?: string (default 'en').
- Region bias —
region?: string for string-based locations.
- Waypoint optimization —
optimizeWaypoints?: boolean (document higher Google billing tier).
- Split waypoints —
splitWaypoints?: boolean to bypass 10/25 waypoint limits by splitting into multiple API requests and merging polylines.
- Traffic / time —
timePrecision?: 'none' | 'now' for realtime traffic duration.
- Polyline precision —
precision?: 'high' | 'low':
high — full step-level polyline detail
low — overview polyline (smoothed, better performance)
- Reset behavior —
resetOnChange?: boolean (default true); when false, keep previous polyline visible while refetching to avoid glitching.
- Channel —
channel?: string for Google API reporting.
- Custom base URL —
directionsServiceBaseUrl?: string (default Google JSON endpoint).
- Pass
waypointOrder from API response through onReady.
- Pass
fare object through onReady when returned (transit).
- Document billing implications for
optimizeWaypoints, splitWaypoints, and timePrecision: 'now'.
Out of scope
Acceptance criteria
- Route with 2+ waypoints renders correctly.
mode, language, and region are forwarded to the Directions API.
optimizeWaypoints: true returns reordered waypointOrder in onReady.
splitWaypoints: true handles >10 waypoints without API failure (multiple segments merged).
timePrecision: 'now' affects duration when traffic data is available.
precision: 'high' produces denser coordinate arrays than 'low'.
resetOnChange: false avoids polyline flicker during refetch.
- Props and callback shapes match react-native-maps-directions documentation where applicable.
- Unit tests for waypoint splitting and query param construction.
Notes
Depends on #6 (package) and #7 (core fetch/render). Align prop names with react-native-maps-directions for easier migration (apikey alias optional).
Context
The core
MapViewDirectionscomponent (#7) covers origin → destination routing. react-native-maps-directions also supports advanced Google Directions options that many production apps rely on: multi-stop routes, travel modes, traffic-aware ETAs, waypoint optimization, and automatic route splitting when waypoint limits are exceeded.Reference props: https://github.com/bramus/react-native-maps-directions#props
Goal
Reach feature parity with react-native-maps-directions advanced routing props:
Scope
waypoints?: (Coordinate | string)[]between origin and destination.mode?: 'DRIVING' | 'BICYCLING' | 'WALKING' | 'TRANSIT'(default'DRIVING').language?: string(default'en').region?: stringfor string-based locations.optimizeWaypoints?: boolean(document higher Google billing tier).splitWaypoints?: booleanto bypass 10/25 waypoint limits by splitting into multiple API requests and merging polylines.timePrecision?: 'none' | 'now'for realtime traffic duration.precision?: 'high' | 'low':high— full step-level polyline detaillow— overview polyline (smoothed, better performance)resetOnChange?: boolean(defaulttrue); whenfalse, keep previous polyline visible while refetching to avoid glitching.channel?: stringfor Google API reporting.directionsServiceBaseUrl?: string(default Google JSON endpoint).waypointOrderfrom API response throughonReady.fareobject throughonReadywhen returned (transit).optimizeWaypoints,splitWaypoints, andtimePrecision: 'now'.Out of scope
place_id:) — Add MapViewDirections advanced routing — waypoints, modes, traffic, split routes #8 handles encoding; this issue consumes already-resolved or string values passed to Google API.Acceptance criteria
mode,language, andregionare forwarded to the Directions API.optimizeWaypoints: truereturns reorderedwaypointOrderinonReady.splitWaypoints: truehandles >10 waypoints without API failure (multiple segments merged).timePrecision: 'now'affects duration when traffic data is available.precision: 'high'produces denser coordinate arrays than'low'.resetOnChange: falseavoids polyline flicker during refetch.Notes
Depends on #6 (package) and #7 (core fetch/render). Align prop names with react-native-maps-directions for easier migration (
apikeyalias optional).