SHARE
TWEET

Untitled

a guest Jan 18th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated {
  2. for (id <MKAnnotation>annotation in _mapView.annotations) {
  3.     // if it's the user location, just return nil.
  4.     if ([annotation isKindOfClass:[MKUserLocation class]])
  5.         continue;
  6.  
  7.     // handle our custom annotations
  8.     //
  9.     if ([annotation isKindOfClass:[XPMKAnnotation class]])
  10.     {
  11.         // try to retrieve an existing pin view first
  12.         MKAnnotationView *pinView = [_mapView viewForAnnotation:annotation];
  13.         //resize the pin view
  14.         double zoomLevel = [_mapView getZoomLevel];
  15.         double scale = (1.0 * zoomLevel / 16) + 0.5;
  16.         pinView.transform = CGAffineTransformMakeScale(scale, scale);
  17.     }
  18.     }
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top