MapKit Functions

The functions of the MapKit framework provide convenient ways to package map-related data structures.

Overview

Symbols

Making Coordinate Structures

Making Map Point Structures

func MKMapPointMake(Double, Double)

Creates a new MKMapPoint structure from the specified values.

func MKMapSizeMake(Double, Double)

Creates a new MKMapSize structure from the specified values.

func MKMapRectMake(Double, Double, Double, Double)

Creates a new MKMapRect structure from the specified values.

Converting Between Data Types

func MKMapPointForCoordinate(CLLocationCoordinate2D)

Returns the map point data structure that corresponds to the specified coordinate.

func MKCoordinateForMapPoint(MKMapPoint)

Returns the latitude and longitude that corresponds to the specified map point.

func MKCoordinateRegionForMapRect(MKMapRect)

Returns the region that corresponds to the specified map rectangle.

Getting Map Units

func MKMetersPerMapPointAtLatitude(CLLocationDegrees)

Returns the distance spanned by one map point at the specified latitude.

func MKMapPointsPerMeterAtLatitude(CLLocationDegrees)

Returns the number of map points that represent one meter at the given latitude.

func MKMetersBetweenMapPoints(MKMapPoint, MKMapPoint)

Returns the number of meters between two map points.

func MKRoadWidthAtZoomScale(MKZoomScale)

Returns the width (in screen points) of roads on a map at the specified zoom level.

Getting Points Along a Map Rectangle

func MKMapRectGetMinX(MKMapRect)

Returns the minimum x-axis value of the specified rectangle.

func MKMapRectGetMinY(MKMapRect)

Returns the minimum y-axis value of the specified rectangle.

func MKMapRectGetMidX(MKMapRect)

Returns the mid-point along the x-axis of the specified rectangle.

func MKMapRectGetMidY(MKMapRect)

Returns the mid-point along the y-axis of the specified rectangle.

func MKMapRectGetMaxX(MKMapRect)

Returns the maximum x-axis value of the specified rectangle.

func MKMapRectGetMaxY(MKMapRect)

Returns the maximum y-axis value of the specified rectangle.

func MKMapRectGetWidth(MKMapRect)

Returns the width of the map rectangle.

func MKMapRectGetHeight(MKMapRect)

Returns the height of the map rectangle.

Comparing Map Values

func MKMapPointEqualToPoint(MKMapPoint, MKMapPoint)

Returns a Boolean value indicating whether the two map points are equal.

func MKMapSizeEqualToSize(MKMapSize, MKMapSize)

Returns a Boolean value indicating whether the two map sizes are equal.

func MKMapRectEqualToRect(MKMapRect, MKMapRect)

Returns a Boolean value indicating whether the two map rectangles are equal

func MKMapRectContainsPoint(MKMapRect, MKMapPoint)

Returns a Boolean value indicating whether the specified map point lies within the rectangle.

func MKMapRectContainsRect(MKMapRect, MKMapRect)

Returns Boolean value indicating whether one rectangle contains another.

func MKMapRectIntersectsRect(MKMapRect, MKMapRect)

Returns a Boolean value indicating whether two rectangles intersect each other.

func MKMapRectIsNull(MKMapRect)

Returns a Boolean indicating whether the specified rectangle is null.

func MKMapRectIsEmpty(MKMapRect)

Returns a Boolean value indicating whether the specified rectangle has no area.

Modifying Map Rectangles

func MKMapRectUnion(MKMapRect, MKMapRect)

Returns a rectangle representing the union of the two rectangles.

func MKMapRectIntersection(MKMapRect, MKMapRect)

Returns the rectangle representing the intersection of two rectangles.

func MKMapRectInset(MKMapRect, Double, Double)

Returns the specified rectangle inset by the specified amounts.

func MKMapRectOffset(MKMapRect, Double, Double)

Returns a rectangle whose origin point is shifted by the specified amount.

Getting Strings for Map Values

func MKStringFromMapPoint(MKMapPoint)

Returns a formatted string for the specified map point.

func MKStringFromMapSize(MKMapSize)

Returns a formatted string for the specified map size.

func MKStringFromMapRect(MKMapRect)

Returns a formatted string for the specified map rectangle.

Determining Map Boundaries

func MKMapRectSpans180thMeridian(MKMapRect)

Returns a Boolean value that indicates whether the specified map rectangle crosses the 180th meridian.

func MKMapRectRemainder(MKMapRect)

Normalizes the portion of the specified rectangle that lies outside the world map boundaries.