Conversation
…es` -> `RouteProgress#hasUnexpectedUpcomingClosures`: the algorithm is checking upcoming closures only, ignoring closures where puck already at.
ChangelogFeatures
Bug fixes and improvements
Known issues
|
libnavigation-base/src/main/java/com/mapbox/navigation/base/utils/route/RouteProgressEx.kt
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## main #6841 +/- ##
============================================
+ Coverage 72.63% 72.64% +0.01%
Complexity 5568 5568
============================================
Files 780 780
Lines 30101 30117 +16
Branches 3556 3560 +4
============================================
+ Hits 21864 21879 +15
Misses 6809 6809
- Partials 1428 1429 +1
|
|
|
||
| /** | ||
| * This function checks whether the [NavigationRoute] has unexpected closures, which could be a reason to re-route. | ||
| * This function checks whether the [NavigationRoute] has unexpected upcoming closures, which could be a reason to re-route. |
There was a problem hiding this comment.
what is the difference between unexpected and expected closure? Is the unexpected the one we receive after route refresh?
There was a problem hiding this comment.
the difference is in snapping options (see com.mapbox.api.directions.v5.models.RouteOptions).
Whenever snapping is not allowed, that means the closure is unexpected
| val snappingResultList = navigationRoute.directionsRoute.getSnappingResultList() | ||
|
|
||
| val routeProgressData = ifNonNull( | ||
| currentLegProgress, |
There was a problem hiding this comment.
Question which is outside of the scope of this PR.
Hm, interesting why current leg progress is nullable. As I see we always create it, don't we?
There was a problem hiding this comment.
I suppose it's in the scope actually. I had the same doubts, found that RouteLegProgress and RouteStepProgress are not null, so we should be good.
libnavigation-base/src/main/java/com/mapbox/navigation/base/utils/route/RouteProgressEx.kt
Outdated
Show resolved
Hide resolved
|
kudos @VysotskiVadim, he caught a nice issue: the |
…es` -> `RouteProgress#hasUnexpectedUpcomingClosures` (#6841) * - Changed experimental extension `NavigationRoute#hasUnexpectedClosures` -> `RouteProgress#hasUnexpectedUpcomingClosures`: the algorithm is checking upcoming closures only, ignoring closures where the puck is already at.
Description
NavigationRoute#hasUnexpectedClosures->RouteProgress#hasUnexpectedUpcomingClosures: the algorithm checks upcoming closures only, ignoring closures where the puck is already at.Screenshots or Gifs