I have an app that uses MKMapView as a main display area. This should always be oriented north-up. But a quick inadvertent swipe and it rotates, cause the compass to appear.
Is there a way to stop this from happening and keep the view locked north? I see a few hints here, but nothing that refers to any sort of built-in mechanism.
A quick look at Apple's documentation on MKMapView:
rotateEnabled A Boolean value indicating whether the map camera’s heading information is used.
@property(nonatomic, getter=isRotateEnabled) BOOL rotateEnabled Discussion When this property is set to YES and a valid camera is associated with the map, the camera’s heading angle is used to rotate the plane of the map around its center point. When this property is set to NO, the camera’s heading angle is ignored and the map is always oriented so that true north is situated at the top of the map view.
So you could try to set your mapview rotateEnabled property to ´NO´.
Apple MKMapView reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With