1
votes

I used to use the userDistanceToManeuverLocation variable from the RouteStepProgress Class but this seems to just return nil recently.

Just in case I was doing something wrong I tried following the MapBox iOS nav tutorial (https://docs.mapbox.com/help/tutorials/ios-navigation-sdk/) but this had the same result.

Going by the MapBox tutorial I would do the following to get the variable:

let navigationViewController = NavigationViewController(for: directionsRoute!)
let distance = navigationViewController.navigationService.routeProgress.currentLegProgress.currentStepProgress.userDistanceToManeuverLocation

I don't seem to see any error messages or other concerns. I would get this variable on every tick of the users location but now just returns nil. Thanks for any help

1

1 Answers

0
votes

So after some testing I figured out the issue is to do with the newer versions of MapBox Navigation (SDK MapboxNavigation). Anything from version 0.29.0 onwards causes issues. For now I'm sticking with version 0.28.0 and will have to report this to MapBox

Edit: It looks like the latest version (MapboxNavigation 0.38.0 at the time of writing this edit) appears to provide a solution. I now use distanceRemaining found in the RouteProgress class which does the same thing.