Class

MKMapItem

A point of interest on the map.

Declaration

@interface MKMapItem : NSObject

Overview

A map item includes a geographic location and any interesting data that might apply to that location, such as the address at that location and the name of a business at that address. You can also create a special MKMapItem object representing the user's current location.

Use this class to do the following:

  • Share map-related data with the Maps app.

  • Handle requests for directions that originate from the Maps app.

To display information in Maps, create an MKMapItem object with the information you want to display and call the openMapsWithItems:launchOptions: method. Maps displays that location on the map and shows the information you provide.

If you implement a routing app, Maps provides you with two MKMapItem objects representing the start and end points. Use the information in those two objects to plot the route and generate directions.

Topics

Creating Map Items

+ mapItemForCurrentLocation

Creates and returns a singleton map item object representing the device’s current location.

- initWithPlacemark:

Initializes and returns a map item object using the specified placemark object.

Accessing the Map Item Attributes

placemark

The placemark object containing the location information.

pointOfInterestCategory

The point of interest category for the map item.

Beta
isCurrentLocation

A Boolean value indicating whether the map item represents the user’s current location.

name

The descriptive name associated with the map item.

phoneNumber

The phone number associated with a business at the specified location.

url

The URL associated with the specified location.

timeZone

The time zone of the specified location.

Launching the Maps App

+ openMapsWithItems:launchOptions:

Open the Maps app and display the specified map items.

- openInMapsWithLaunchOptions:

Open the Maps app and display this map item.

Serializing a Map Item

MKMapItemTypeIdentifier

A constant indicating the type of a serialized map item.

Opening Items at Launch Time

Launch Options Dictionary Keys

Launch options to specify when opening map items in the Maps app.

Directions Mode Values

Strings representing the possible values of the MKLaunchOptionsDirectionsModeKey key.

Relationships

Inherits From

See Also

Map Fundamentals

MKMapView

An embeddable map interface, similar to the one provided by the Maps application.

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