The scrollEnabled seems to be breakable once the user starts pinching in a MKMapView.
You still can’t scroll with one finger, but if you scroll with two fingers while zooming in and out, you can move the map.
I have tried :
- Subclassing the
MKMapKitto disable the scroll view inside it. - Implementing –
mapView:regionWillChangeAnimated:to enforce the center. - Disabling
scrollEnabled.
but with no luck.
Can anyone tell me a sure way to ONLY have zooming in a MKMapView, so the center point always stays in the middle ?
You can try to handle the pinch gestures yourself using a
UIPinchGestureRecognizer:First set
scrollEnabledandzoomEnabledtoNOand create the gesture recognizer:In the recognizer handler adjust the
MKCoordinateSpanaccording to the zoom scale:This may not work perfectly like Apple’s implementation but it should solve your issue.