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

Route Refresh #2366

Merged
merged 6 commits into from
Sep 4, 2020
Merged

Route Refresh #2366

merged 6 commits into from
Sep 4, 2020

Conversation

Udumft
Copy link
Contributor

@Udumft Udumft commented Apr 24, 2020

Traffic congestion segments along the route line and the estimated arrival time periodically update to reflect current conditions when using the DirectionsProfileIdentifier.automobileAvoidingTraffic profile. These updates correspond to the new Notification.Name.routeControllerDidRefreshRoute notification, NavigationServiceDelegate.navigationService(_:didRefresh:) method, and NavigationViewControllerDelegate.navigationViewController(_:didRefresh:) method. To disable these updates, set RouteOptions.refreshingEnabled to false.

The NavigationViewController.route and NavigationService.route properties are now read-only. To change the route that the user is traveling along, set the NavigationViewController.indexedRoute or NavigationService.indexedRoute property instead, pairing the route with the index of the route in the original RouteResponse object.

The following methods now require a route index to be passed in as an argument:

  • NavigationViewController(for:routeIndex:routeOptions:navigationOptions:)
  • NavigationViewController(route:routeIndex:routeOptions:navigationService:)
  • CarPlayManagerDelegate.carPlayManager(_:navigationServiceAlong:routeIndex:routeOptions:desiredSimulationMode:)
  • MapboxNavigationService(route:routeIndex:routeOptions:)
  • MapboxNavigationService(route:routeIndex:routeOptions:directions:locationSource:eventsManagerType:simulating:routerType:)
  • RouteProgress(route:routeIndex:options:legIndex:spokenInstructionIndex:)
  • RouteProgress(route:routeIndex:options:legIndex:spokenInstructionIndex:)
  • Router(along:routeIndex:options:directions:dataSource:)
  • RouteController(along:routeIndex:options:directions:dataSource:)

Resolves #2284


Work-In-Progress
So far added basic implementation for calling Route Refresh. Experimenting with RouteProgress to refresh it's Route contents (suggestions are welcome).
Thinking about route refresh period setting to be related with better route search period

@Udumft Udumft added platform parity Required to keep on par with Android. op-ex Refactoring, Tech Debt or any other operational excellence work. feature New feature request. topic: directions labels Apr 24, 2020
@Udumft Udumft added this to the v1.0.0 milestone Apr 24, 2020
@Udumft Udumft self-assigned this Apr 24, 2020
@1ec5 1ec5 added the release blocker Needs to be resolved before the release. label Aug 24, 2020
@asinghal22
Copy link

Discussed today with Antonio and Hossam. Not a release blocker for v1.0 marketing push. We will backport to v1.0 branch and include as part of v1.0.x

@asinghal22 asinghal22 removed the release blocker Needs to be resolved before the release. label Aug 25, 2020
@asinghal22
Copy link

Removed the release blocker sticker.

@1ec5 1ec5 added the release blocker Needs to be resolved before the release. label Aug 31, 2020
MapboxCoreNavigation/CoreConstants.swift Outdated Show resolved Hide resolved
MapboxCoreNavigation/Router.swift Outdated Show resolved Hide resolved
@1ec5 1ec5 mentioned this pull request Sep 2, 2020
@1ec5
Copy link
Contributor

1ec5 commented Sep 2, 2020

I expanded the scope of this PR in #2591. If approved, that PR would merge into this one and we’d be pretty close to landing the feature.

@1ec5 1ec5 self-assigned this Sep 3, 2020
…tal idea about RouteProgress route refreshing.
1ec5 and others added 5 commits September 3, 2020 16:39
Keep track of the route’s index in the overall route response and use it when refreshing the route. Added a route index argument to a litany of public and private methods and initializers.

Explicitly merge the skeletal refreshed route into the original route.
Post a notification and inform the navigation service and navigation view controller delegates whenever the route is refreshed. On refresh, update the route line to reflect the new traffic congestion data.
@1ec5 1ec5 marked this pull request as ready for review September 3, 2020 23:55
@1ec5 1ec5 merged commit c945bcf into master Sep 4, 2020
@1ec5 1ec5 deleted the 2284-route-refresh branch September 4, 2020 00:12
@1ec5 1ec5 added the backwards incompatible changes that break backwards compatibility of public API label Sep 4, 2020
@1ec5
Copy link
Contributor

1ec5 commented Sep 4, 2020

I missed a couple spots when adding routeIndex: to various initialization calls: #2598.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backwards incompatible changes that break backwards compatibility of public API feature New feature request. op-ex Refactoring, Tech Debt or any other operational excellence work. platform parity Required to keep on par with Android. release blocker Needs to be resolved before the release. topic: directions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Periodically refresh the route with the latest traffic and ETAs
4 participants