Last active
August 29, 2015 14:06
-
-
Save filipbec/8219f82bc29dc9d37fd7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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