How do you rotate a map on a desktop pc (am using Windows)?
On touch devices, there is a property that you can set to allow rotating the map by twisting using two fingers:
map.rotationByPinchingEnabled
I tried using a button that on clicked would set the map.rotation property which sort of works but ends up with a weird effect where the rectangle representing the map rotates leaving whitespace around the edge as per the attached screenshot. There must be another method?
Solved! Go to Solution.
Hi Paul,
You need to use map.setRotation().
map.setMapRotation(map.rotation - 15, 0,0)
Let me know how you go.
Cheers,
Gareth
On ArcGIS desktop you use the "Data Frame" toolbar to rotate the frame relative to the data.
But you are probably talking about some programmatic way of doing this.
Hi Paul,
You need to use map.setRotation().
map.setMapRotation(map.rotation - 15, 0,0)
Let me know how you go.
Cheers,
Gareth
Thanks Gareth - not sure how I missed seeing that one!
slight correction for anyone stumbing across this, the map property is map.mapRotation, the code I used in order to rotate around the center of the page...
map.setMapRotation(map.mapRotation + 15, (app.width * 0.5) , (app.height * 0.5) )