Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated {
- for (id <MKAnnotation>annotation in _mapView.annotations) {
- // if it's the user location, just return nil.
- if ([annotation isKindOfClass:[MKUserLocation class]])
- continue;
- // handle our custom annotations
- //
- if ([annotation isKindOfClass:[XPMKAnnotation class]])
- {
- // try to retrieve an existing pin view first
- MKAnnotationView *pinView = [_mapView viewForAnnotation:annotation];
- //resize the pin view
- double zoomLevel = [_mapView getZoomLevel];
- double scale = (1.0 * zoomLevel / 16) + 0.5;
- pinView.transform = CGAffineTransformMakeScale(scale, scale);
- }
- }
- }
Add Comment
Please, Sign In to add comment