Skip to content

Commit cb39496

Browse files
authored
Use matched location from NN to calculate RouteProgress.distanceTraveled (#4043)
1 parent 0d14001 commit cb39496

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
* Fixed an error when rerouting the user with `NavigationRouteOptions.profileIdentifier` set to `ProfileIdentifier.walking` or `ProfileIdentifier.cycling`. ([#4024](https://github.com/mapbox/mapbox-navigation-ios/pull/4024))
3434
* Fixed an issue where the user’s location continued to be snapped to a roadway even after the user’s course deviated significantly from that roadway, for example because the user was actually on a parallel road. ([#4012](https://github.com/mapbox/mapbox-navigation-ios/pull/4012))
35+
* Fixed an issue when `RouteController` didn't update `RouteProgress.distanceTraveled` property during simulation. ([#4043](https://github.com/mapbox/mapbox-navigation-ios/pull/4043))
3536

3637
### Other changes
3738

Sources/MapboxCoreNavigation/LegacyRouteController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ open class LegacyRouteController: NSObject, Router, InternalRouter, CLLocationMa
433433
}
434434

435435
private func update(progress: RouteProgress, with location: CLLocation, rawLocation: CLLocation) {
436-
progress.updateDistanceTraveled(with: rawLocation)
436+
progress.updateDistanceTraveled(with: location)
437437

438438
//Fire the delegate method
439439
delegate?.router(self, didUpdate: progress, with: location, rawLocation: rawLocation)

Sources/MapboxCoreNavigation/RouteController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ open class RouteController: NSObject {
518518
}
519519

520520
private func update(progress: RouteProgress, with location: CLLocation, rawLocation: CLLocation, upcomingRouteAlerts routeAlerts: [UpcomingRouteAlert], mapMatchingResult: MapMatchingResult) {
521-
progress.updateDistanceTraveled(with: rawLocation)
521+
progress.updateDistanceTraveled(with: location)
522522
progress.upcomingRouteAlerts = routeAlerts.map { RouteAlert($0) }
523523

524524
//Fire the delegate method

0 commit comments

Comments
 (0)