Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
- (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated
double scale = self.mapView.bounds.size.width / self.mapView.visibleMapRect.size.width;
if (scale < <#yourScaleLimit#>) {
[[NSOperationQueue new] addOperationWithBlock:^{
NSArray *annotations = [self.clusteringManager clusteredAnnotationsWithinMapRect:mapView.visibleMapRect withZoomScale:scale];
[self.clusteringManager setAnnotations:annotations forMapView:self.mapView];
} else {
[[NSOperationQueue new] addOperationWithBlock:^{
[self.clusteringManager setAnnotations:<#self.annotationsArray#> forMapView:self.mapView];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.