Guest User

Untitled

a guest
Jan 18th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment