Instance Method

mapRect(for:)

Returns the rectangle on the map that corresponds to the specified rectangle in the overlay renderer’s drawing area.

Declaration

func mapRect(for rect: CGRect) -> MKMapRect

Parameters

rect

The rectangle in the overlay’s drawing area that you want to convert.

Return Value

The rectangle on the two-dimensional map projection corresponding to the specified rectangle.

Discussion

You may call this method safely from your view’s draw(_:zoomScale:in:) method.

See Also

Converting Points on the Map

func point(for: MKMapPoint) -> CGPoint

Returns the point in the overlay renderer’s drawing area corresponding to the specified point on the map.

func mapPoint(for: CGPoint) -> MKMapPoint

Returns the point on the map that corresponds to the specified point in the overlay renderer’s drawing area.

func rect(for: MKMapRect) -> CGRect

Returns the rectangle in the overlay renderer’s drawing area corresponding to the specified rectangle on the map.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software