Skip to content

Commit 7886707

Browse files
authored
Remove arrow if the route line is removed after arrival (#4040)
1 parent 16511a5 commit 7886707

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* Each alternative route shown during turn-by-turn navigation is now annotated with the amount of time it saves or adds to the trip. To hide these annotations, set the `NavigationMapView.showsRelativeDurationOnContinuousAlternativeRoutes` property to `false`. ([#3956](https://github.com/mapbox/mapbox-navigation-ios/pull/3956))
1414
* Fixed the issue where the route line endpoint is ahead of user location indicator on short straight-line route step when `NavigationViewController.routeLineTracksTraversal` enabled in active navigation. ([#3992](https://github.com/mapbox/mapbox-navigation-ios/pull/3992))
1515
* Added the ability to provide duration and completion handler while visualizing routes using `NavigationMapView.showcase(_:animated:duration:completion:)`. ([#4022](https://github.com/mapbox/mapbox-navigation-ios/pull/4022))
16+
* Fixed an issue where the maneuver arrow is not removed after arriving to the final destination. ([#4040](https://github.com/mapbox/mapbox-navigation-ios/pull/4040))
1617

1718
### CarPlay
1819

Sources/MapboxNavigation/CarPlayNavigationViewController.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,10 +864,14 @@ open class CarPlayNavigationViewController: UIViewController, BuildingHighlighti
864864
let legIndex = progress.legIndex
865865
let nextStep = progress.currentLegProgress.stepIndex + 1
866866

867-
navigationMapView?.addArrow(route: progress.route, legIndex: legIndex, stepIndex: nextStep)
868867
navigationMapView?.updateRouteLine(routeProgress: progress,
869868
coordinate: navigationService.router.location?.coordinate,
870869
shouldRedraw: true)
870+
if navigationMapView?.routes != nil {
871+
navigationMapView?.addArrow(route: progress.route, legIndex: legIndex, stepIndex: nextStep)
872+
} else {
873+
navigationMapView?.removeArrow()
874+
}
871875
navigationMapView?.showWaypoints(on: progress.route, legIndex: legIndex)
872876
}
873877

Sources/MapboxNavigation/NavigationMapView+VanishingRouteLine.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ extension NavigationMapView {
6363
guard !routeProgress.routeIsComplete else {
6464
removeRoutes()
6565
removeContinuousAlternativesRoutes()
66+
removeArrow()
6667
return
6768
}
6869

Sources/MapboxNavigation/RouteLineController.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ extension NavigationMapView {
4646
let currentLegProgress = router.routeProgress.currentLegProgress
4747
let nextStepIndex = currentLegProgress.stepIndex + 1
4848

49-
if nextStepIndex <= currentLegProgress.leg.steps.count {
49+
if nextStepIndex <= currentLegProgress.leg.steps.count,
50+
navigationMapView.routes != nil {
5051
navigationMapView.addArrow(route: router.route, legIndex: router.routeProgress.legIndex, stepIndex: nextStepIndex)
5152
}
5253

@@ -106,7 +107,8 @@ extension NavigationMapView {
106107
}
107108

108109
private func updateMapOverlays(for routeProgress: RouteProgress) {
109-
if routeProgress.currentLegProgress.followOnStep != nil {
110+
if routeProgress.currentLegProgress.followOnStep != nil,
111+
navigationMapView.routes != nil {
110112
navigationMapView.addArrow(route: routeProgress.route,
111113
legIndex: routeProgress.legIndex,
112114
stepIndex: routeProgress.currentLegProgress.stepIndex + 1)

0 commit comments

Comments
 (0)