mapbox / mapbox/mapbox-navigation-ios

First waypoint is missing - didArriveAt not called

Open
#1,785 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

archived
Dominant language
Swift
Stars
918
Forks
326
Avg merge
1h 16m
Merged PRs (30d)
3

Description

**Mapbox Navigation SDK version:**
- Mapbox-iOS-SDK 4.4.1
- MapboxCoreNavigation 0.22.2
- MapboxMobileEvents 0.6.0
- MapboxNavigation 0.22.2
- MapboxNavigationNative 3.1.5
- MapboxSpeech 0.0.2

Hi,

we’re using the Mapbox Navigation SDK in the latest version and I’m having some troubles with the handling of our waypoints. In our example we’re using a route with 8 waypoints and the Mapbox Directions instance calculates a route containing 8 legs between these waypoints. So far so good.

But as soon as we start to actual navigation things get weird. The first waypoint is never visible to the user, instead only 7 (sometimes even less) waypoints are visible on the map. It seems that during the initial presentation the location of the use gets determined and we see the position marker move across the map to the users current location. By doing so - and that’s only my guess - the very first waypoint get’s immediately completed / invalidated.

I would accept this as a technical limitation due to poor GPS reception. It would certainly be better if the first waypoint would only be completed as the user really passes this waypoint and not only has been there for just ‘a second’ (while the location gets determined).

The real problem here is the fact, that the delegate method `navigationViewController(_ navigationViewController: NavigationViewController, didArriveAt waypoint: Waypoint)` won’t be called. Even though the waypoint was in the list we’ve got from the Directions instance and even though the waypoint is visible for just a second. The delegate won't be called. Instead this delegate will only be called as soon as the user passes the second (or any following) waypoint.

So in the end my questions are:
1. Is there a way to prevent Mapbox from immediately invalidating the first waypoint. It would be useful to only invalidate waypoints if the users location has actually be determined with some precision and not anytime before that.
2. What about the `didArriveAt` delegate - even though the first waypoint has - immediately - been passed, it will not be called.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the reported eight-waypoint route and observe the initial location handling in NavigationViewController. Trace when the first waypoint is invalidated and when navigationViewController(_:didArriveAt:) is invoked. Done means the first waypoint is handled consistently and its arrival callback behavior matches the documented expectation.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.