Instance Method

convert(_:toPointTo:)

Converts a map coordinate to a point in the specified view.

Declaration

iOS, tvOS
func convert(_ coordinate: CLLocationCoordinate2D, toPointTo view: UIView?) -> CGPoint
macOS
func convert(_ coordinate: CLLocationCoordinate2D, toPointTo view: NSView?) -> CGPoint

Parameters

coordinate

The map coordinate for which you want to find the corresponding point.

view

The view in whose coordinate system you want to locate the specified map coordinate. If this parameter is nil, the returned point is specified in the window’s coordinate system. If view is not nil, it must belong to the same window as the map view.

Return Value

The point (in the appropriate view or window coordinate system) corresponding to the specified latitude and longitude value.

See Also

Converting Map Coordinates

func convert(CGPoint, toCoordinateFrom: UIView?)

Converts a point in the specified view’s coordinate system to a map coordinate.

func convertRegion(MKCoordinateRegion, toRectTo: UIView?)

Converts a map region to a rectangle in the specified view.

func convert(CGRect, toRegionFrom: UIView?)

Converts a rectangle in the specified view’s coordinate system to a map region.