I have a MKMapView in my app with some overlays, which are shown correctly.
These overlays draw images inside the
- (void) drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context
The MapView allows zooming and i want to avoid drawing the images at a specific zoom level
Is there a way to determine inside this method whether the overlay rectangle is greater than the mapview rectangle?
Let’s say your overlay is made from
myOverlay(MyOverlay *)andmyOverlayView(MyOverlayView *)Inside
- (void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)contextyou can get reference tomyOverlaylike this:It should be easy to compare
myOverlay.boundingRectandmapRectfrom here on.