maplibre / maplibre-navigation-android

Maplibre Navigation SDK for Android
MIT License
86 stars 44 forks source link

Fix leg annotation calculation #86

Closed boldtrn closed 10 months ago

boldtrn commented 10 months ago

Currently there are a few minor bugs when calculating the leg annotations.

When you go offroute and calculate a new route, the leg annotation is not reset, which will lead to wrong distanceIndex in NavigationHelper.

The same happens when you progress from legindex N to N+1.

Additionally, there is a bug when you start a fresh navigation, that the route progress is calculated twice. In the first calculation the step distance remaining was missing, which lead to an incorrect legindex. We removed the first route progress calculation and made sure that the route progress is not required before that anymore.

Fabi755 commented 10 months ago

Is it possible to add a test case for this?

boldtrn commented 10 months ago

Thanks @Fabi755, yes, we just found a few other things as well. We created tests and changelog entries for this and this PR should be ready for review. I will update the description above.