Structure

MKMapRect

A rectangular area on a two-dimensional map projection.

Overview

If you project the curved surface of the globe onto a flat surface, what you get is a two-dimensional version of a map where longitude lines appear to be parallel. Such maps are often used to show the entire surface of the globe all at once. An MKMapRect data structure represents a rectangular area as seen on this two-dimensional map.

Topics

Initializers

init()

Initializes the rectangle with an empty region.

init(origin: MKMapPoint, size: MKMapSize)

Initializes the map rect with the specified point and size.

Coordinates

var origin: MKMapPoint

The origin point of the rectangle.

var size: MKMapSize

The width and height of the rectangle, starting from the origin point.

Creation

func MKMapRectMake(Double, Double, Double, Double)

Creates a new MKMapRect structure from the specified values.

Metrics

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.

Conversion

func MKCoordinateRegionForMapRect(MKMapRect)

Returns the region that corresponds to the specified map rectangle.

func MKStringFromMapRect(MKMapRect)

Returns a formatted string for the specified map rectangle.

Comparison

func MKMapRectIsNull(MKMapRect)

Returns a Boolean indicating whether the specified rectangle is null.

func MKMapRectEqualToRect(MKMapRect, MKMapRect)

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

func MKMapRectIsEmpty(MKMapRect)

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

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.

Containment

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.

Modifications

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.

See Also

Map Coordinates

struct MKCoordinateRegion

A rectangular geographic region centered around a specific latitude and longitude.

struct MKCoordinateSpan

The width and height of a map region.

struct MKMapPoint

A point on a two-dimensional map projection.

struct MKMapSize

Width and height information on a two-dimensional map projection.

class MKDistanceFormatter

A utility object that converts between a geographic distance and a string-based expression of that distance.