Instance Method


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


func canDraw(_ mapRect: MKMapRect, zoomScale: MKZoomScale) -> Bool



The map rectangle that needs to be updated.


The current scale factor applied to the map.

Return Value

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


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 false from this method to indicate that it is not ready. An overlay renderer might also return false if it does not draw content in the specified rectangle.

If you return false from this method, your application is responsible for calling the setNeedsDisplay(_:zoomScale:) method when the overlay renderer subsequently becomes ready to draw its contents.

The default implementation of this method returns true.

See Also

Drawing the Overlay

func draw(MKMapRect, zoomScale: MKZoomScale, in: CGContext)

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

func setNeedsDisplay()

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

func setNeedsDisplay(MKMapRect)

Invalidates the specified portion of the overlay at all zoom scales

func setNeedsDisplay(MKMapRect, zoomScale: MKZoomScale)

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