3

Google Maps has had this for a while (double tap then hold and slide finger up or down to zoom in or out) but Apple is just adding it to their Apple Maps app in iOS 11.

It does not seem like they are going to add this to MKMapView, at least not in the current betas.

If Apple does not give MKMapView this functionality how would I do this using gestures? Has anyone else done this?

Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412

1 Answers1

-1

This will help you to zoom out to world-view.

// step.1 create co-ordianate-span as follows
MKCoordinateSpan span = {.latitudeDelta = 180, .longitudeDelta = 360};

// step.2 crate region as follows
MKCoordinateRegion region = MKCoordinateRegionMake(CLLocationCoordinate2DMake(0.0000f, 0.0000f), span);

// step.3 zoom using region to map as follows
[self.mapView setRegion:region animated:YES];
Balasubramanian
  • 5,274
  • 6
  • 33
  • 62
  • I know how to zoom into an `MKMapView`. I guess my question really is how can I smoothly zoom in or out using a gesture to slide my finger up and down. – Nic Hubbard Jul 24 '17 at 17:30
  • 1
    @NicHubbard You have to attach to `UIGestureRecognizerDelegate` protocol and implement. [this answer](https://stackoverflow.com/a/5089553/3694459) might help you. – Balasubramanian Jul 24 '17 at 17:42
  • This works for me: https://stackoverflow.com/questions/15848897/doubletap-and-slide-drag-finger-to-zoom-in-out/47271219#47271219 – user2488730 Feb 26 '18 at 18:48