mapbox / mapbox/mapbox-navigation-android
Off-route is detected very late, when user moved approx 0.1 mile away from route.
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 651
- Forks
- 321
- PR merge metrics
- No merged PRs in 30d
Description
**Android API: 29**
**Mapbox Maps SDK version: 9.6.1**
**Mapbox Navigation UI SDK version: 1.5.1**
I was exploring **MapBox Direction API** using **Walking profile** and experienced the following issue
### Steps to trigger behavior
1. Draw a route on Mapbox map using Direction API
2. Add Off-rotue observer on navigation
3. Start the navigation on route
4. Go off-route (away from blue color route)
**Location** - Chicago, USA
**Direction API Request**
Start Coordinate - 41.882569, -87.636612
Destination Coordinate - 41.883301, -87.635309
`
val walking: WalkingOptions = WalkingOptions.builder().alleyBias(1.0).walkwayBias(1.0).build()
mapboxNavigation.requestRoutes(
RouteOptions.builder()
.accessToken(accessToken)
.baseUrl(RouteUrl.BASE_URL)
.user(RouteUrl.PROFILE_DEFAULT_USER)
.requestUuid("")
.coordinates(listOf(coordinateList.first(), coordinateList.last()))
.geometries(RouteUrl.GEOMETRY_POLYLINE6)
.profile(RouteUrl.PROFILE_WALKING)
.steps(true)
.overview(RouteUrl.OVERVIEW_FULL)
.bannerInstructions(true)
.walkingOptions(walking)
.build(),
routesReqCallback
)
`
### Expected behavior
Off-route detection shall be faster and Mapbox shall inform that user has gone off-route within 5 seconds
### Actual behavior
Mapbox informs that user has gone off-route after 35-40 seconds approx, when user has moved 0.1 mile away from the route.
[Note: Please see in attached snapshot. How far user's location is from blue route and toast message is being displayed as soon as user goes off-route.]
**I checked this scenario in Google and found working as expected. Please let me know if this is a bug in MapBox Direction API or am I missing any configuration in my code?**

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the walking-navigation scenario on Android API 29 with the listed SDK versions, using the provided route coordinates and off-route observer steps. Then inspect the navigation entry points involved in off-route callbacks and measure the delay; done means the behavior is explained and, if confirmed as a bug, off-route notification meets the stated expectation or the issue is documented as configuration-dependent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- api, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100