Instance Method

canDrawMapRect:zoomScale:

Returns a Boolean value indicating whether the overlay view is ready to draw its content.

Declaration

- (BOOL)canDrawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale;

Parameters

mapRect

The map rectangle that needs to be updated.

zoomScale

The current scale factor applied to the map.

Return Value

YES if this overlay renderer is ready to draw its contents on the map or NO if it is not.

Discussion

Overlay renderers can override this method in situations where they may depend on the availability of other information to draw their contents. For example, a renderer showing traffic information might want to delay drawing until it has all of the traffic data it needs. In such a case, it can return NO from this method to indicate that it is not ready. An overlay renderer might also return NO if it does not draw content in the specified rectangle.

If you return NO from this method, your application is responsible for calling the setNeedsDisplayInMapRect:zoomScale: method when the overlay renderer subsequently becomes ready to draw its contents.

The default implementation of this method returns YES.

See Also

Drawing the Overlay

- drawMapRect:zoomScale:inContext:

Draws the overlay’s contents at the specified location on the map.

- setNeedsDisplay

Invalidates the entire contents of the overlay for all zoom scales.

- setNeedsDisplayInMapRect:

Invalidates the specified portion of the overlay at all zoom scales

- setNeedsDisplayInMapRect:zoomScale:

Invalidates the specified portion of the overlay but only at the specified zoom scale.