I am using HERE MAPS PREMIUM SDK for my application. I need my current location icon to be rotated as the direction changes. Similar to Current location indicator in other maps. Since HERE SDK doesn't have default method to it, I am using following code to rotate Position Indicator whenever onPositionUpdated() callback gets called as below,
private PositioningManager.OnPositionChangedListener mapPositionHandler = new PositioningManager.OnPositionChangedListener() {
@Override
public void onPositionUpdated(PositioningManager.LocationMethod method, GeoPosition position,
boolean isMapMatched) {
Matrix matrix = new Matrix();
matrix.postRotate((float) mHeading - mMap.getOrientation());
Bitmap newBitmap = Bitmap.createBitmap(myLocationIcon, 0, 0, myLocationIcon.getWidth(), myLocationIcon.getHeight(), matrix, true);
Image newImage = new Image();
newImage.setBitmap(newBitmap);
if (mMapFragment.getPositionIndicator() != null) {
mMapFragment.getPositionIndicator().setMarker(newImage);
}
}
This code works as expected but the position Doesn't updated smoothly. it's kind of bouncing whenever position updates. Any suggestion on this would be so helpful.