MKMapItem

This blog entry was written to help highlight the dictionary keys and values available through a MKLocalSearchRequest using Apple’s MapKit framework.

MapKit

To make use of Apple’s built in MapKit you must first explicitly import the framework under your Xcode project settings, Build Phases, Link Binary With Libraries.

Xcode Project Build Phases

With the framework imported you can now expose the MapKit classes and methods in your custom ViewControllers with the following header.

#import <MapKit/MapKit.h>

MKLocalSearchRequest

I’ve included an example MKLocalSearchRequest below, for the place mark and map data of the Empire State Building. This will also populate an annotation to add to your MKMapView.

MKLocalSearchRequest example gist.

MKPointAnnotation for the Empire State Building.

MKMapItem keys and values

Below is the MKMapItem’s dictionary keys and values for the MKLocalSearchRequest above. I hope this helps show the data available to you within MapKit and what MKLocalSearchRequest and the iOS MapKit API gives you out of the box.

{isCurrentLocation = 0;
name = “Empire State Building”;
phoneNumber = “+12127363100";
placemark = “Empire State Building, 350 5th Ave, New York, NY 10118, United States @ <+40.74845200,-73.98559500> +/- 0.00m, region CLCircularRegion (identifier:’<+40.74843812,-73.98575535> radius 101.50', center:<+40.74843812,-73.98575535>, radius:101.50m)”;
 url = “http://www.esbnyc.com/";}

Happy coding.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.