Skip to content

Instantly share code, notes, and snippets.

@myell0w
Created May 11, 2011 11:21
Show Gist options
  • Save myell0w/966302 to your computer and use it in GitHub Desktop.
Save myell0w/966302 to your computer and use it in GitHub Desktop.
MKMapView Annotations
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation {
// .. Code for other annotations …
if ([annotation isMemberOfClass:[SPCluster class]]) {
MKAnnotationView *annotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:kClusterAnnotationViewIdentifier];
if (!annotationView) {
annotationView = [[SPClusterView alloc] initWithAnnotation:annotation reuseIdentifier:kClusterAnnotationViewIdentifier];
}
}
[annotationView setTransformAccordingToMapView:mapView];
return annotationView;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment