Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rotate MapView?

I am a new developer for Android. Tried to rotate MapView in circular motion. But I don't know how to begin.

Do you have a simple code to rotate the MapView?

like image 612
Ferdinand Avatar asked Feb 02 '23 21:02

Ferdinand


1 Answers

I have done this in the past and it requires to create a custom ViewGroup that rotates the Canvas in the dispatchDraw() method. You also need to increase the size of the MapView (so that it draws enough pixels when rotated.) You will also need to rotate the touch events in dispatchTouchEvent(). Or if you use Android 3.0 you can simply call theMapView.rotate() :)

like image 96
Romain Guy Avatar answered Feb 06 '23 15:02

Romain Guy