stadiamaps / ferrostar

A FOSS navigation SDK built from the ground up for the future
https://stadiamaps.github.io/ferrostar/
Other
88 stars 9 forks source link

Recalculation framework for when the user is off course #50

Closed ianthetechie closed 3 months ago

ianthetechie commented 3 months ago

After some discussion, we have elected to go the "framework" route for recalculation. While users of Ferrostar will always be able to access state updates, including whether the user has deviated from the route, recalculation is common enough and annoying enough that we see value in offering a "full-service framework" approach to recalculation for the common case.

What this means:

  1. The FerrostarCore at the imperative shell level (iOS / Android) will watch for route deviations.
  2. When a deviation is detected, it will do some sanity checks (did we recalculate recently? Do we already have a request in flight? etc...) and, if applicable, invoke getRoutes and then invoke a delegate method informing the application of the available alternative routes.