Map Kit Data Types Reference

Framework
MapKit/MapKit.h
Companion guide
Declared in
MKGeometry.h

Overview

This document describes the data types found in the Map Kit framework.

Data Types

MKCoordinateSpan

A structure that defines the area spanned by a map region.

typedef struct {
   CLLocationDegrees latitudeDelta;
   CLLocationDegrees longitudeDelta;
} MKCoordinateSpan;
Fields
latitudeDelta

The amount of north-to-south distance (measured in degrees) to display on the map. Unlike longitudinal distances, which vary based on the latitude, one degree of latitude is always approximately 111 kilometers (69 miles).

longitudeDelta

The amount of east-to-west distance (measured in degrees) to display for the map region. The number of kilometers spanned by a longitude range varies based on the current latitude. For example, one degree of longitude spans a distance of approximately 111 kilometers (69 miles) at the equator but shrinks to 0 kilometers at the poles.

Discussion

You use the delta values in this structure to indicate the desired zoom level of the map, with smaller delta values corresponding to a higher zoom level.

Availability
  • Available in iOS 3.0 and later.
Declared In
MKGeometry.h

MKCoordinateRegion

A structure that defines which portion of the map to display.

typedef struct {
   CLLocationCoordinate2D center;
   MKCoordinateSpan span;
} MKCoordinateRegion;
Fields
center

The center point of the region.

span

The horizontal and vertical span representing the amount of map to display. The span also defines the current zoom level used by the map view object.

Availability
  • Available in iOS 3.0 and later.
Declared In
MKGeometry.h

MKMapPoint

A point on a two-dimensional map projection.

typedef struct {
   double x;
   double y;
} MKMapPoint;
Fields
x

The location of the point along the x-axis of the map.

y

The location of the point along the y-axis of the map.

Discussion

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 MKMapPoint data structure represents a point on this two-dimensional map.

The actual units of a map point are tied to the underlying units used to draw the contents of an MKMapView, but you should never need to worry about these units directly. You use map points primarily to simplify computations that would be complex to do using coordinate values on a curved surface. By converting to map points, you can perform those calculations on a flat surface, which is generally much simpler, and then convert back as needed. You can map between coordinate values and map points using the MKMapPointForCoordinate and MKCoordinateForMapPoint functions.

When saving map-related data to a file, you should always save coordinate values (latitude and longitude) and not map points.

Availability
  • Available in iOS 4.0 and later.
Declared In
MKGeometry.h

MKMapSize

Size information as measured on a two-dimensional map projection.

typedef struct {
   double width;
   double height;
} MKMapSize;
Fields
width

The width value. The units of this value are map points.

height

The height value. The units of this value are map points.

Discussion

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 MKMapSize data structure represents a horizontal and vertical distance as measured on this two-dimensional map.

Availability
  • Available in iOS 4.0 and later.
Declared In
MKGeometry.h

MKMapRect

A rectangular area as measured on a two-dimensional map projection.

typedef struct {
   MKMapPoint origin;
   MKMapSize size;
} MKMapRect;
Fields
origin

The origin point of the rectangle.

size

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

Discussion

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.

Availability
  • Available in iOS 4.0 and later.
Declared In
MKGeometry.h

MKZoomScale

A scale factor being used in conjunction with a map.

typedef CGFloat MKZoomScale;
Availability
  • Available in iOS 4.0 and later.
Declared In
MKGeometry.h