Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## master

* Speculatively fixed spurious rerouting when passing an intermediate waypoint. ([#1869](https://github.com/mapbox/mapbox-navigation-ios/pull/1869))

### CarPlay

* When selecting a search result in CarPlay, the resulting routes lead to the search result’s routable location when available. Routes to a routable location are more likely to be passable. ([#1859](https://github.com/mapbox/mapbox-navigation-ios/pull/1859))
Expand Down
6 changes: 6 additions & 0 deletions MapboxCoreNavigation/RouteController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ open class RouteController: NSObject, Router {
Monitors the user's course to see if it is consistantly moving away from what we expect the course to be at a given point.
*/
func userCourseIsOnRoute(_ location: CLLocation) -> Bool {
// if we have yet to travel along the current leg, don't check for heading conformance
guard routeProgress.currentLegProgress.distanceTraveled > 0 else {
movementsAwayFromRoute = 0
return true
}

let nearByCoordinates = routeProgress.currentLegProgress.nearbyCoordinates
guard let calculatedCourseForLocationOnStep = location.interpolatedCourse(along: nearByCoordinates) else { return true }

Expand Down