heremaps / here-android-sdk-examples

Java-based projects using the HERE SDK for Android.
Apache License 2.0
145 stars 191 forks source link

Are there any variants to get bearing of the calculated route? #476

Closed Strikelon closed 2 years ago

Strikelon commented 2 years ago

Hi, could you advice please.

For instance I calculated the route with FTCRRouter().calculateRoute(ftcrRoutePlan) and I got the FTCRRoute

Are there any ways to get the bearing from this route, if I want to rotate the map to the direction of the route, without navigation manager tracking.

Thank you!

NazarKacharaba commented 2 years ago

Hi @Strikelon Bearing is just a degree between two locations, and FTCRRoute consists of a set of locations (route.getGeometry()). So you can not calculate bearing between device location and FTCRRoute. You will have to take a certain location on the route and use it as a second value for bearing calculation - GeoCoordinate.getHeading(GeoCoordinate).

Strikelon commented 2 years ago

Thanks!