Select to view content in your preferred language

How to programatically rotate a mapView object on android?

2429
2
Jump to solution
02-02-2014 08:28 PM
DanVinokour
New Contributor
Hi,

My android device has a resistive screen which means no multi-touch.
So i put two buttons on my MapView object and i want by pressing them to rotate the map left or right.
I was unsuccessful so far.
Ill appreciate you help.
thanks,
Dan.
0 Kudos
1 Solution

Accepted Solutions
ShellyGill1
Esri Contributor
Hi Dan,

You should be able to use the setRotation method on the MapView to set the rotation angle of the map.
https://developers.arcgis.com/android/api-reference/reference/com/esri/android/map/MapView.html#setR...

You can see an example of this in the Map Rotation sample - this sample sets a listener so that a single tap on the map will re-set the rotation angle of the map back to 0. There are overloads of this method available with alternative parameters.

View solution in original post

0 Kudos
2 Replies
ShellyGill1
Esri Contributor
Hi Dan,

You should be able to use the setRotation method on the MapView to set the rotation angle of the map.
https://developers.arcgis.com/android/api-reference/reference/com/esri/android/map/MapView.html#setR...

You can see an example of this in the Map Rotation sample - this sample sets a listener so that a single tap on the map will re-set the rotation angle of the map back to 0. There are overloads of this method available with alternative parameters.
0 Kudos
DanVinokour
New Contributor
Thnx, but how can i tell the mapview to make the rotation command?
do i have to issue a set of motion commands and if so, what is the best set of commands? or is there a better way?

Thank you,
Dan.
0 Kudos