Search code examples
androidhere-api

MapMarker orientation in HereMaps


I'm creating a navigation app using HereMaps Android SDK. To show the current position, I use MapMarker as my cursor. Everything works ok except that I can't orient the MapMarker to the route direction. I need the MapMarker to rotate accordingly. Is this possible? I can't seem to find any API to do this.


Solution

  • Unfortunately, the HERE Mobile SDK MapMarker rotates to match the rotation of the map such that it is always facing 'North' and there is no way to change that behavior at this time.

    One option is to use a MapLocalModel instead as described in this post and set your image to its texture. Then you can rotate the MapLocalModel as desired.

    Alternatively, you could do some image manipulation to actually rotate the Image being used on the MapMarker in code, but this would likely not be very performant.