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

Getting Oriented with MapKit

on

  • 7,468 views

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.

Statistics

Views

Total Views
7,468
Views on SlideShare
6,462
Embed Views
1,006

Actions

Likes
6
Downloads
0
Comments
0

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
More...

Accessibility

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.

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

Getting Oriented with MapKit Presentation Transcript

  • 1. Getting Oriented with MapKit Julio Barros Julio@E-String.com
  • 2. 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
  • 3. Dark ages (pre 3.0) • Static map images • Web view with Javascript shenanigans • Exit out to google maps Julio Barros E-String.com
  • 4. MapKit • New in iPhone 3.x • Embed map in your app • Uses Google map tiles • Familiar map UI Julio Barros E-String.com
  • 5. Important Classes MKMapView MKAnnotation (protocol) MKAnnotationView Julio Barros E-String.com
  • 6. Important Classes MKMapView MKMapViewDelegate MKAnnotation (protocol) MKAnnotationView MKPinAnnotationView Julio Barros E-String.com
  • 7. Simplest Example • MKMapView ... just a view • Or use Interface Builder • Don’t forget to add mapkit framework Julio Barros E-String.com
  • 8. That was easy Julio Barros E-String.com
  • 9. Show User Location Julio Barros E-String.com
  • 10. Showing a particular area on the map Latitude Span Center “best fit” not exactly what you set Longitude Span Julio Barros E-String.com
  • 11. Regions • MKCoordinateRegion Julio Barros E-String.com
  • 12. Denver, Colorado Julio Barros E-String.com
  • 13. Demo data plist of Brewery information: name, address, latitude, longitude Julio Barros E-String.com
  • 14. Loading Demo Data Julio Barros E-String.com
  • 15. Local area Julio Barros E-String.com
  • 16. MKAnnotation Julio Barros E-String.com
  • 17. MyAnnotation Class Julio Barros E-String.com
  • 18. Adding Annotations Julio Barros E-String.com
  • 19. Default Pins at annotations Julio Barros E-String.com
  • 20. Customizing pins • MKPinAnnotationView • MKMapViewDelegate - set a delegate Julio Barros E-String.com
  • 21. Our purple pins Julio Barros E-String.com
  • 22. Custom markers • MKAnnotationView Julio Barros E-String.com
  • 23. Customizing the view Julio Barros E-String.com
  • 24. Customizing the Callout Julio Barros E-String.com
  • 25. Tapping the call out view Julio Barros E-String.com
  • 26. Reverse Geocoding • Geocoding : address to coordinates • geocoder.us other services • Reverse geocoding : coordinates to address Julio Barros E-String.com
  • 27. MKReverseGeocoder Julio Barros E-String.com
  • 28. 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
  • 29. 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
  • 30. 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
  • 31. 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
  • 32. 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
  • 33. Resources • MapKit Framework Reference - Apple • Using Map Kit with Bill Dudney - PragProg • Using Map Kit ... Bill Dudney - Wednesday Julio Barros E-String.com
  • 34. 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