• Save
Getting Oriented with MapKit
Upcoming SlideShare
Loading in...5

Getting Oriented with MapKit



Slides of a presentation I did at 360iDev in Denver in September 2009. Sample code is available at E-String.com

Slides of a presentation I did at 360iDev in Denver in September 2009. Sample code is available at E-String.com
Let me know if you have any questions.



Total Views
Views on SlideShare
Embed Views



36 Embeds 1,006

http://iphonecodesamples.blogspot.com 665
http://iphonecodesamples.blogspot.in 118
http://iphonecodesamples.blogspot.co.uk 18
http://cocoatouchdown.blogspot.com 18
http://iphonecodesamples.blogspot.com.au 15
http://iphonecodesamples.blogspot.de 13
http://www.slideshare.net 12
http://iphonecodesamples.blogspot.com.es 12
http://iphonecodesamples.blogspot.tw 12
http://iphonecodesamples.blogspot.it 11
http://murathacioglu.blogspot.com 11
http://iphonecodesamples.blogspot.com.br 10
http://iphonecodesamples.blogspot.mx 9
http://iphonecodesamples.blogspot.ca 9
http://iphonecodesamples.blogspot.sg 8
http://iphonecodesamples.blogspot.hk 7
http://iphonecodesamples.blogspot.gr 7
http://iphonecodesamples.blogspot.kr 7
http://www.hacioglumurat.com 7
http://iphonecodesamples.blogspot.fr 5
http://translate.googleusercontent.com 4
http://iphonecodesamples.blogspot.co.il 3
http://iphonecodesamples.blogspot.com.ar 3
http://iphonecodesamples.blogspot.jp 3
http://iphonecodesamples.blogspot.se 3
http://iphonecodesamples.blogspot.nl 3
http://www.bloxoo.com 2
http://iphonecodesamples.blogspot.ch 2
http://iphonecodesamples.blogspot.fi 2
http://www.murathacioglu.blogspot.com 1
http://iphonecodesamples.blogspot.co.at 1
http://iphonecodesamples.blogspot.no 1
http://iphonecodesamples.blogspot.co.nz 1
http://iphonecodesamples.blogspot.pt 1
http://webcache.googleusercontent.com 1
http://murathacioglu.blogspot.com.tr 1


Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Getting Oriented with MapKit Getting Oriented with MapKit Presentation Transcript

  • Getting Oriented with MapKit Julio Barros Julio@E-String.com
  • Why Maps? • iPhone is a mobile / pocket computer • Where am I? • How do I get somewhere? • What’s near me? Julio Barros E-String.com
  • Dark ages (pre 3.0) • Static map images • Web view with Javascript shenanigans • Exit out to google maps Julio Barros E-String.com
  • MapKit • New in iPhone 3.x • Embed map in your app • Uses Google map tiles • Familiar map UI Julio Barros E-String.com
  • Important Classes MKMapView MKAnnotation (protocol) MKAnnotationView Julio Barros E-String.com
  • Important Classes MKMapView MKMapViewDelegate MKAnnotation (protocol) MKAnnotationView MKPinAnnotationView Julio Barros E-String.com
  • Simplest Example • MKMapView ... just a view • Or use Interface Builder • Don’t forget to add mapkit framework Julio Barros E-String.com
  • That was easy Julio Barros E-String.com
  • Show User Location Julio Barros E-String.com
  • Showing a particular area on the map Latitude Span Center “best fit” not exactly what you set Longitude Span Julio Barros E-String.com
  • Regions • MKCoordinateRegion Julio Barros E-String.com
  • Denver, Colorado Julio Barros E-String.com
  • Demo data plist of Brewery information: name, address, latitude, longitude Julio Barros E-String.com
  • Loading Demo Data Julio Barros E-String.com
  • Local area Julio Barros E-String.com
  • MKAnnotation Julio Barros E-String.com
  • MyAnnotation Class Julio Barros E-String.com
  • Adding Annotations Julio Barros E-String.com
  • Default Pins at annotations Julio Barros E-String.com
  • Customizing pins • MKPinAnnotationView • MKMapViewDelegate - set a delegate Julio Barros E-String.com
  • Our purple pins Julio Barros E-String.com
  • Custom markers • MKAnnotationView Julio Barros E-String.com
  • Customizing the view Julio Barros E-String.com
  • Customizing the Callout Julio Barros E-String.com
  • Tapping the call out view Julio Barros E-String.com
  • Reverse Geocoding • Geocoding : address to coordinates • geocoder.us other services • Reverse geocoding : coordinates to address Julio Barros E-String.com
  • MKReverseGeocoder Julio Barros E-String.com
  • MKPlacemark • Address info including, country code, country, postal code, administrative area, sub administrative area, locality, sub locality, thoroughfare, sub thoroughfare • Conforms to MKAnnotation • Has address dictionary with Address Book keys Julio Barros E-String.com
  • Number of pins • Try to limit annotations to ~100(?) • Implement region change delegate methods • Create and manage your own clusters Julio Barros E-String.com
  • Challenges • Anchoring an object to a location on the map and having it scale. • Shapes - neighborhoods • Lines - routes / paths • View space to Geo Space - (CGPoint)convertCoordinate:(CLLocationCoordinate2D) coordinate toPointToView:(UIView *)view - (CLLocationCoordinate2D)convertPoint:(CGPoint)point toCoordinateFromView:(UIView *)view Julio Barros E-String.com
  • Legal limitations I’m not a lawyer but think carefully before using this for: vehicle/fleet tracking routing cacheing tiles geocoding / mass reverse geocoding Read the TOS http://code.google.com/apis/maps/iphone/ terms.html Julio Barros E-String.com
  • Possible Options • OpenStreetMap.org (OSM) - map/tile data • Route-Me - OSS map view • Cloudemade.com - services around OSM • geocoder.us (among others) Julio Barros E-String.com
  • Resources • MapKit Framework Reference - Apple • Using Map Kit with Bill Dudney - PragProg • Using Map Kit ... Bill Dudney - Wednesday Julio Barros E-String.com
  • Thank You Julio Barros Julio@E-String.com http://www.E-String.com http://twitter.com/JulioBarros Also on Face book and Linked In Julio Barros E-String.com