SlideShare a Scribd company logo
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

More Related Content

Similar to Getting Oriented with MapKit (20)

PDF
Building Mobile Cross-Platform Geospatial Apps, Nick Landry
Xamarin
 
PDF
AtlasCT - Atlas Mobile Maps API for iOS
Yogev Triki
 
ZIP
WhereCamp EU talk: iPhone location 101
Michael Dales
 
PDF
Intro To Google Maps
Eric ShangKuan
 
KEY
Where 2.0
davejohnson
 
PDF
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Chris Adamson
 
PDF
Geolocation and Mapping
Ivano Malavolta
 
PDF
iTimer - Count On Your Time
rahulmonikasharma
 
PDF
PHPUG - Geo Maps for papaya CMS
Martin Kelm
 
PPTX
Google Map Implementation with offline feature.
Jayanta Sinhamahapatra
 
PPT
Google Maps API
hchen1
 
PPTX
Presentazione Google
FLT.lab
 
PPT
11 ways to locate your users. - options for LBS.
Martijn Pannevis
 
PPT
Google Geo APIs Overview
Ossama Alami
 
PDF
"Open Mapping on iOS" — Justin Miller, MapBox
Yandex
 
PPTX
NYU final project
Daniel Yoon
 
PDF
Google Developer Day 2010 Japan: Android や iPhone で活用する Maps API のモバイル端末向け新機能...
Google Developer Relations Team
 
PDF
Visualize Your Data
Kyung Yoo
 
KEY
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
CoLab Athens
 
PDF
Google maps platform product pitch deck
Shruti M
 
Building Mobile Cross-Platform Geospatial Apps, Nick Landry
Xamarin
 
AtlasCT - Atlas Mobile Maps API for iOS
Yogev Triki
 
WhereCamp EU talk: iPhone location 101
Michael Dales
 
Intro To Google Maps
Eric ShangKuan
 
Where 2.0
davejohnson
 
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Chris Adamson
 
Geolocation and Mapping
Ivano Malavolta
 
iTimer - Count On Your Time
rahulmonikasharma
 
PHPUG - Geo Maps for papaya CMS
Martin Kelm
 
Google Map Implementation with offline feature.
Jayanta Sinhamahapatra
 
Google Maps API
hchen1
 
Presentazione Google
FLT.lab
 
11 ways to locate your users. - options for LBS.
Martijn Pannevis
 
Google Geo APIs Overview
Ossama Alami
 
"Open Mapping on iOS" — Justin Miller, MapBox
Yandex
 
NYU final project
Daniel Yoon
 
Google Developer Day 2010 Japan: Android や iPhone で活用する Maps API のモバイル端末向け新機能...
Google Developer Relations Team
 
Visualize Your Data
Kyung Yoo
 
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
CoLab Athens
 
Google maps platform product pitch deck
Shruti M
 

Recently uploaded (20)

PPTX
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
PDF
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Apache CloudStack 201: Let's Design & Build an IaaS Cloud
ShapeBlue
 
PDF
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
PDF
Rethinking Security Operations - SOC Evolution Journey.pdf
Haris Chughtai
 
PDF
Meetup Kickoff & Welcome - Rohit Yadav, CSIUG Chairman
ShapeBlue
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
PPTX
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
July Patch Tuesday
Ivanti
 
Apache CloudStack 201: Let's Design & Build an IaaS Cloud
ShapeBlue
 
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
Rethinking Security Operations - SOC Evolution Journey.pdf
Haris Chughtai
 
Meetup Kickoff & Welcome - Rohit Yadav, CSIUG Chairman
ShapeBlue
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
Ad

Getting Oriented with MapKit