Chapter 17. The Map Kit framework

 

This chapter covers

  • Overview of Map Kit
  • Adding a map to an application
  • Reverse geocoding
  • Annotating the map

17.1. Overview of Map Kit

Since Apple opened up the iPhone SDK, developers have been trying to find ways to integrate maps into their applications. Prior to the release of iPhone OS 3.0, there was no elegant way to do this.

One of the more popular solutions involved displaying a Google map in a UIWebView and laying another view on top to capture the user input. As you can imagine, this approach was clunky and prone to error if Google changed its web interface. Apple finally provided a solution called the Map Kit framework.

With the release of the Map Kit framework, you can now add fully functional and customizable maps to any application. This framework provides you with a simple view that you can add anywhere you want a map to appear.

In addition to the adding the map, you can add custom annotations such as pins to show more information about a specific location..

17.2. Adding a map to an application

Adding a map to an application is similar to adding any other view. You can either do it through Interface Builder or programmatically. The choice is up to you, depending on how you like to work with UI elements. We’ll show you both methods.

17.3. Reverse geocoding

17.4. Annotating the map

17.5. Summary