Description
Currently faster route logic will fetch faster route every 5 minutes (customizable, but not less then 2 minutes), and determine that route is faster, if it's at least 10% (not customizable) faster than the current one.
Then, after 5 minutes when faster route is requested, there are two possible situations:
- there is route faster than the current.
FasterRouteObserver will call onFasterRoute with current route and an alternatives list,isAlternativeFaster == true
; alternatives will still contain current route in the list of alternatives. - there is no faster route, our route is still fastest.
FasterRouteObserver will call onFasterRoute with current route, alternatives list withalternatives[0]
the same current route andisAlternativesFaster == false
. That was fixed at Faster route does not guarantee new route is different #3144 / Compare routes using step names #3301.
Couple of questions / notes regarding this:
-
If user would like to still make use of it, even if we don't say new route is faster, they'll need to filter current route in some way (also, maybe compare it with the current RouteProgress), facing with the same complexities that we've dealt in Compare routes using step names #3301.
What I would expect is thatalternatives
list should not contain the current route at all. Suppose we could filter it out from the alternatives. -
By the way why the minimum 2 minutes limit was introduced? It's a bit weird that setting this value less that 2 minutes will just crash the application in runtime without any prior warnings.
-
Could we customize 10% limit when calculating logic of faster route? We've ended up implementing similar logic on our side since had a requirement to show any faster route, even 1 second faster than current.
cc @mapbox/navigation-android; @kmadsen since you've implemented #3301