ArcGIS Runtime SDK for macOS

Map rotation

Description

This sample demonstrates how to rotate a map using the slider.

How it works

To set rotation of a map, AGSMapView provides a few methods. You can use the setViewpointRotation:completion: method and give it an angle in degrees. Or you can create a rotated AGSViewpoint using initWithCenter:scale:rotation: or initWithTargetExtent:rotation: and set it using the following methods on AGSMapView - setViewpoint:, setViewpoint:completion:, setViewpoint:duration:completion:, setViewpoint:duration:curve:completion:. To listen for rotation angle changes, AGSMapView provides a block called visibleAreaChangedHandler which fires each time the visible area of the map view changes. The change could be because of a pan or a zoom or a rotation or a combination of these. You can also check the current rotation angle of a map by using the rotation property on AGSMapView


In this topic
  1. Description