maplibre / maplibre-navigation-android

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

Fix snap-to-route crash #106

Closed Fabi755 closed 3 months ago

Fabi755 commented 5 months ago

I discovered that legs that contains only a single step will cause a IndexOutOfBoundsException crash.

Cause was only a wrong if-condition. But to prevent a wrong bearing of 0, I adjust the fetching of the upcoming step.

Fabi755 commented 4 months ago

I removed the loop now.

If the necessary points not available, the logic is fallback to the last calculated bearing. If them also not available it will fallback to the real location bearing.