Skip to content

Instantly share code, notes, and snippets.

@u10int
Created November 30, 2012 20:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save u10int/4178336 to your computer and use it in GitHub Desktop.
Save u10int/4178336 to your computer and use it in GitHub Desktop.
@implementation MKMapView (ZoomLevel)
- (NSUInteger) zoomLevel {
return (21 - round(log2(self.region.span.longitudeDelta * MERCATOR_RADIUS * M_PI / (180.0 * self.bounds.size.width))));
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment