mapbox / mapbox/mapbox-navigation-ios

Using NavigationService without NavigationViewController

Open
#2,540 3 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: "v1.0.0-alpha.1"**

I've been trying to achieve this for a few days now: I have a map (using the standard Mapbox SDK) where a user can do custom route planning. When the user chose the route I have it calculated and passed it to the `NavigationViewController` which will then initialise the turn-by-turn instructions.

What I'm trying to achieve now is that the same map is used for planning as for navigation. I've studied the SDK documentation in the last days and it seems that I can achieve this by using the `NavigationService` and listening on the delegate calls (e.g. `func navigationService(_ service: NavigationService, didUpdate progress: RouteProgress, with location: CLLocation, rawLocation: CLLocation)`.

However, I do not retrieve delegate calls for the rerouting notification. Initially, the `didUpdate progress` call will be received (with well-formed information) but I won't get any data in the future.

This brings me to the following questions:

1. Can such behaviour as described above (Using the `NavigationService` without the `NavigationViewController`) be achieved at all?
2. Is there an issue with using the Xcode Location Simulator to trigger rerouting? I'm using GPX-files for simulation as I don't want to run outside to actually trigger the rerouting
3. Why am I not getting any future `didUpdate progress` calls and what would be a way to continuously monitor e.g. the distance to the next step of a route?
4. Maybe a bit of a side-question: What's the difference between the `CLLocationManager`, `MGLLocationManager` and `NavigationLocationManager`? This is really confusing me.

Thank you very much for your help. Feel free to get in touch with me through E-Mail or on GitHub.

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 reading the NavigationService delegate callbacks and the NavigationViewController integration described in the issue, then compare the roles of CLLocationManager, MGLLocationManager, and NavigationLocationManager. Check the GPX location-simulation behavior and determine whether standalone progress and rerouting callbacks are supported; done requires a settled explanation or a clearly scoped fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.