Compass work example Java

How to rotate the map according to my position using the compass. Please give me an example in Java

Hi.

I’m not sure whether I understand fully your question.

You can use the CameraPosition class to rotate your map:
this.tomtomMap.getUiSettings().setCameraPosition(CameraPosition.builder().bearing(55).build());

To rotate only a compass icon you can use the following code:
this.tomtomMap.getUiSettings().getCompassView().rotate(55);

Hope this helps,
Mateusz

1 Like