Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NavigationMapView.routeLineTracksTraversal only works inside NavigationViewController #2526

Closed
1ec5 opened this issue Aug 5, 2020 · 0 comments · Fixed by #2581
Closed

NavigationMapView.routeLineTracksTraversal only works inside NavigationViewController #2526

1ec5 opened this issue Aug 5, 2020 · 0 comments · Fixed by #2581
Assignees
Labels
bug Something isn’t working CarPlay Bugs, improvements and feature requests on Apple CarPlay op-ex Refactoring, Tech Debt or any other operational excellence work.
Milestone

Comments

@1ec5
Copy link
Contributor

1ec5 commented Aug 5, 2020

NavigationMapView.routeLineTracksTraversal is billed as an option to enable the “erasing route line” or “vanishing route line” feature on any NavigationMapView (#1307). But this property only works when the map view is embedded inside a NavigationViewController, because the only thing that reads the property is in RouteMapViewController. Nor does the feature work in CarPlay, which has a CarPlayNavigationViewController instead of a NavigationViewController.

if mapView.routeLineTracksTraversal {
mapView.fadeRoute(progress.fractionTraveled)
}

Unusually, NavigationMapView.fadeRoute(_:) is an internal method not exposed publicly, so there’s no workaround for an application that implements its own custom UI for turn-by-turn navigation.

func fadeRoute(_ fractionTraveled: Double) {

We should rename fadeRoute(_:) to updateRoute(for:), have it take a RouteProgress instead of a raw number, and expose it publicly. Since routeLineTracksTraversal is dependent on functionality outside of NavigationMapView, namely progress updates, we should either move it to NavigationViewController or move that conditional inside updateRoute(for:). Finally, we should call updateRoute(for:) from within CarPlayNavigationViewController.progressDidChange(_:) too.

/cc @mapbox/navigation-ios @d-prukop @avi-c @captainbarbosa

@1ec5 1ec5 added bug Something isn’t working op-ex Refactoring, Tech Debt or any other operational excellence work. CarPlay Bugs, improvements and feature requests on Apple CarPlay labels Aug 5, 2020
@1ec5 1ec5 added this to the v1.0.0 milestone Aug 5, 2020
@MaximAlien MaximAlien self-assigned this Aug 31, 2020
@MaximAlien MaximAlien linked a pull request Aug 31, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working CarPlay Bugs, improvements and feature requests on Apple CarPlay op-ex Refactoring, Tech Debt or any other operational excellence work.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants