SlideShare uma empresa Scribd logo
1 de 34
An Intro to MapKit
Rob Caporetto
@rob_caporetto
The Plan
The Plan
What is MapKit?
The Plan
What is MapKit?
Adding MapKit to your iPhone Application
The Plan
What is MapKit?
Adding MapKit to your iPhone Application
Setting the Position
The Plan
What is MapKit?
Adding MapKit to your iPhone Application
Setting the Position
Annotations
The Plan
What is MapKit?
Adding MapKit to your iPhone Application
Setting the Position
Annotations
Geocoding
The Plan
What is MapKit?
Adding MapKit to your iPhone Application
Setting the Position
Annotations
Geocoding
Interacting with Core Location
What is MapKit?
Embed Maps in your App
Adding MapKit to your App
Adding MapKit to your App

Add the Mapkit & CoreLocation frameworks
Create a View Controller which implements
MKMapViewDelegate
Create an MKMapView instance and connect to the
controller
Setting the Position


 Set the region property
 Defines the center point and a span
 Span defines the vertical & horizontal distance to
 display
Setting the Position

- (void)viewDidLoad
{
  MKCoordinateRegion region;
  region.center.latitude = [eventVenue.latitude doubleValue];
  region.center.longitude = [eventVenue.longitude doubleValue];
  region.span.latitudeDelta = 0.0039;
  region.span.longitudeDelta = 0.0034;

    mapView.region = region;
}
Annotations
Annotations


Allow you to add places-of-interest to a Map
Implemented with a Model & a View
Annotation Models


Implement the MKAnnotation protocol
Exposes a Title, Subtitle, and Coordinate
Title
Title   Subtitle
Title      Subtitle
Coordinate
Annotation Views


Use MKAnnotationView
Easiest trick to set the image property
Use MKPinAnnotationView if you want the Pin
Managing Annotation Views



Managed like UITableViewCells
Managing Annotation Views
- (MKAnnotationView *)mapView:(MKMapView *)theMapView
            viewForAnnotation:(id <MKAnnotation>)annotation
{
  MKPinAnnotationView *annotationView =
    (MKPinAnnotationView *)([theMapView
      dequeueReusableAnnotationViewWithIdentifier:@"annotation"]);

    if (annotationView == NULL)
    {
      annotationView = [[[MKPinAnnotationView alloc]
        initWithAnnotation:annotation reuseIdentifier:@"annotation"] autorelease];
      annotationView.canShowCallout = YES;
      annotationView.animatesDrop = YES;
    }

    annotationView.annotation = annotation;
    return annotationView;
}
Geocoding
Geocoding


Convert Landmarks into Longitude/Latitude
and vice-versa
SDK 3.0 Supports Reverse Geocoding only
Reverse Geocoding


Use MKReverseGeocoder
Requires network access (Wifi/3G/EDGE)
Asynchronous lookups
Interacting with Core
Location
Showing the User’s Location


Set the showsUserLocation property on the
MapView instance
Implement an Annotation
Showing the User’s Location


- (void)viewDidLoad
{
  // Other initialisation…

    mapView.showsUserLocation = YES;
}
Showing the User’s Location

- (MKAnnotationView *)mapView:(MKMapView *)theMapView
            viewForAnnotation:(id <MKAnnotation>)annotation
{
  // Checks to see if we are going to add the annotation for the users's location.
  // If this is the case, then we don't bother with creating an annotation and let
  // the platform give us the blue dot.
  if (annotation == mapView.userLocation) return nil;

    // Configuring other annotations…
}
Resources

WWDC 2009: Sessions 118 & 119
LocateMe Sample Application
PragProg MapKit Screencast:
  http://pragprog.com/screencasts/v-bdmapkit

Mais conteúdo relacionado

Mais procurados

Where20 2008 Ruby Tutorial
Where20 2008 Ruby TutorialWhere20 2008 Ruby Tutorial
Where20 2008 Ruby TutorialShoaib Burq
 
Computer Graphics Project on Sinking Ship using OpenGL
Computer Graphics Project on Sinking Ship using OpenGLComputer Graphics Project on Sinking Ship using OpenGL
Computer Graphics Project on Sinking Ship using OpenGLSharath Raj
 
[shaderx7] 4.1 Practical Cascaded Shadow Maps
[shaderx7] 4.1 Practical Cascaded Shadow Maps[shaderx7] 4.1 Practical Cascaded Shadow Maps
[shaderx7] 4.1 Practical Cascaded Shadow Maps종빈 오
 
Of Nodes and Maps (Web Mapping with Drupal - Part II)
Of Nodes and Maps (Web Mapping with Drupal - Part II)Of Nodes and Maps (Web Mapping with Drupal - Part II)
Of Nodes and Maps (Web Mapping with Drupal - Part II)Ranel Padon
 
Learn how to do stylized shading with Shader Graph – Unite Copenhagen 2019
Learn how to do stylized shading with Shader Graph – Unite Copenhagen 2019Learn how to do stylized shading with Shader Graph – Unite Copenhagen 2019
Learn how to do stylized shading with Shader Graph – Unite Copenhagen 2019Unity Technologies
 
Mapstraction
MapstractionMapstraction
Mapstractionlokku
 
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019Unity Technologies
 
GDC 2014 - Deformable Snow Rendering in Batman: Arkham Origins
GDC 2014 - Deformable Snow Rendering in Batman: Arkham OriginsGDC 2014 - Deformable Snow Rendering in Batman: Arkham Origins
GDC 2014 - Deformable Snow Rendering in Batman: Arkham OriginsColin Barré-Brisebois
 
GDC16: Improving geometry culling for Deus Ex: Mankind Divided by Nicolas Trudel
GDC16: Improving geometry culling for Deus Ex: Mankind Divided by Nicolas TrudelGDC16: Improving geometry culling for Deus Ex: Mankind Divided by Nicolas Trudel
GDC16: Improving geometry culling for Deus Ex: Mankind Divided by Nicolas TrudelUmbra Software
 
Easily Create Maps in Drupal with Leaflet
Easily Create Maps in Drupal with LeafletEasily Create Maps in Drupal with Leaflet
Easily Create Maps in Drupal with LeafletAmber Matz
 

Mais procurados (17)

Where20 2008 Ruby Tutorial
Where20 2008 Ruby TutorialWhere20 2008 Ruby Tutorial
Where20 2008 Ruby Tutorial
 
Computer Graphics Project on Sinking Ship using OpenGL
Computer Graphics Project on Sinking Ship using OpenGLComputer Graphics Project on Sinking Ship using OpenGL
Computer Graphics Project on Sinking Ship using OpenGL
 
51811680 open layers
51811680 open layers51811680 open layers
51811680 open layers
 
[shaderx7] 4.1 Practical Cascaded Shadow Maps
[shaderx7] 4.1 Practical Cascaded Shadow Maps[shaderx7] 4.1 Practical Cascaded Shadow Maps
[shaderx7] 4.1 Practical Cascaded Shadow Maps
 
Of Nodes and Maps (Web Mapping with Drupal - Part II)
Of Nodes and Maps (Web Mapping with Drupal - Part II)Of Nodes and Maps (Web Mapping with Drupal - Part II)
Of Nodes and Maps (Web Mapping with Drupal - Part II)
 
QGIS training class 2
QGIS training class 2QGIS training class 2
QGIS training class 2
 
Learn how to do stylized shading with Shader Graph – Unite Copenhagen 2019
Learn how to do stylized shading with Shader Graph – Unite Copenhagen 2019Learn how to do stylized shading with Shader Graph – Unite Copenhagen 2019
Learn how to do stylized shading with Shader Graph – Unite Copenhagen 2019
 
DSM Extraction from Pleiades Images using Micmac
DSM Extraction from Pleiades Images using MicmacDSM Extraction from Pleiades Images using Micmac
DSM Extraction from Pleiades Images using Micmac
 
Mapstraction
MapstractionMapstraction
Mapstraction
 
Google Maps API 101
Google Maps API 101Google Maps API 101
Google Maps API 101
 
DSM Extraction from Pleiades Images using MICMAC
DSM Extraction from Pleiades Images using MICMAC DSM Extraction from Pleiades Images using MICMAC
DSM Extraction from Pleiades Images using MICMAC
 
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
 
GDC 2014 - Deformable Snow Rendering in Batman: Arkham Origins
GDC 2014 - Deformable Snow Rendering in Batman: Arkham OriginsGDC 2014 - Deformable Snow Rendering in Batman: Arkham Origins
GDC 2014 - Deformable Snow Rendering in Batman: Arkham Origins
 
Intro To Google Maps
Intro To Google MapsIntro To Google Maps
Intro To Google Maps
 
GeoPython 2021 - Mapquadlib
GeoPython 2021 - MapquadlibGeoPython 2021 - Mapquadlib
GeoPython 2021 - Mapquadlib
 
GDC16: Improving geometry culling for Deus Ex: Mankind Divided by Nicolas Trudel
GDC16: Improving geometry culling for Deus Ex: Mankind Divided by Nicolas TrudelGDC16: Improving geometry culling for Deus Ex: Mankind Divided by Nicolas Trudel
GDC16: Improving geometry culling for Deus Ex: Mankind Divided by Nicolas Trudel
 
Easily Create Maps in Drupal with Leaflet
Easily Create Maps in Drupal with LeafletEasily Create Maps in Drupal with Leaflet
Easily Create Maps in Drupal with Leaflet
 

Semelhante a Introduction to MapKit

Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...Chris Adamson
 
How to use geolocation in react native apps
How to use geolocation in react native appsHow to use geolocation in react native apps
How to use geolocation in react native appsInnovationM
 
Maps API on_mobile_dev_festbangkok
Maps API on_mobile_dev_festbangkokMaps API on_mobile_dev_festbangkok
Maps API on_mobile_dev_festbangkokss318
 
3D Touch: Preparando sua app para o futuro do iOS
3D Touch: Preparando sua app para o futuro do iOS3D Touch: Preparando sua app para o futuro do iOS
3D Touch: Preparando sua app para o futuro do iOSRodrigo Borges
 
Average- An android project
Average- An android projectAverage- An android project
Average- An android projectIpsit Dash
 
iOS Development (Part 3) - Additional GUI Components
iOS Development (Part 3) - Additional GUI ComponentsiOS Development (Part 3) - Additional GUI Components
iOS Development (Part 3) - Additional GUI ComponentsAsim Rais Siddiqui
 
Enhance your world with ARKit. UA Mobile 2017.
Enhance your world with ARKit. UA Mobile 2017.Enhance your world with ARKit. UA Mobile 2017.
Enhance your world with ARKit. UA Mobile 2017.UA Mobile
 
HTML5勉強会#23_GeoHex
HTML5勉強会#23_GeoHexHTML5勉強会#23_GeoHex
HTML5勉強会#23_GeoHexTadayasu Sasada
 
LUMIA APP LABS: HERE MAPS AND LOCATION APIS FOR WINDOWS PHONE
LUMIA APP LABS: HERE MAPS AND LOCATION APIS FOR WINDOWS PHONELUMIA APP LABS: HERE MAPS AND LOCATION APIS FOR WINDOWS PHONE
LUMIA APP LABS: HERE MAPS AND LOCATION APIS FOR WINDOWS PHONEMicrosoft Mobile Developer
 
Android Location-based應用開發分享
Android Location-based應用開發分享Android Location-based應用開發分享
Android Location-based應用開發分享koji lin
 
Augmented Reality on iPhone Applications
Augmented Reality on iPhone ApplicationsAugmented Reality on iPhone Applications
Augmented Reality on iPhone ApplicationsOmar Cafini
 
203 Is It Real or Is It Virtual? Augmented Reality on the iPhone
203 Is It Real or Is It Virtual? Augmented Reality on the iPhone203 Is It Real or Is It Virtual? Augmented Reality on the iPhone
203 Is It Real or Is It Virtual? Augmented Reality on the iPhonejonmarimba
 
Breizhcamp Rennes 2011
Breizhcamp Rennes 2011Breizhcamp Rennes 2011
Breizhcamp Rennes 2011sekond0
 
Sirius Web Advanced : Customize and Extend the Platform
Sirius Web Advanced : Customize and Extend the PlatformSirius Web Advanced : Customize and Extend the Platform
Sirius Web Advanced : Customize and Extend the PlatformObeo
 
Gestures
GesturesGestures
GesturesSV.CO
 
CocoaHeads Toulouse - Guillaume Cerquant - UIView
CocoaHeads Toulouse - Guillaume Cerquant - UIViewCocoaHeads Toulouse - Guillaume Cerquant - UIView
CocoaHeads Toulouse - Guillaume Cerquant - UIViewCocoaHeads France
 
Workshop 25: React Native - Components
Workshop 25: React Native - ComponentsWorkshop 25: React Native - Components
Workshop 25: React Native - ComponentsVisual Engineering
 
Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...
Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...
Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...LogeekNightUkraine
 

Semelhante a Introduction to MapKit (20)

Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
 
How to use geolocation in react native apps
How to use geolocation in react native appsHow to use geolocation in react native apps
How to use geolocation in react native apps
 
Maps API on_mobile_dev_festbangkok
Maps API on_mobile_dev_festbangkokMaps API on_mobile_dev_festbangkok
Maps API on_mobile_dev_festbangkok
 
DIY Uber
DIY UberDIY Uber
DIY Uber
 
3D Touch: Preparando sua app para o futuro do iOS
3D Touch: Preparando sua app para o futuro do iOS3D Touch: Preparando sua app para o futuro do iOS
3D Touch: Preparando sua app para o futuro do iOS
 
Average- An android project
Average- An android projectAverage- An android project
Average- An android project
 
iOS Development (Part 3) - Additional GUI Components
iOS Development (Part 3) - Additional GUI ComponentsiOS Development (Part 3) - Additional GUI Components
iOS Development (Part 3) - Additional GUI Components
 
Enhance your world with ARKit. UA Mobile 2017.
Enhance your world with ARKit. UA Mobile 2017.Enhance your world with ARKit. UA Mobile 2017.
Enhance your world with ARKit. UA Mobile 2017.
 
HTML5勉強会#23_GeoHex
HTML5勉強会#23_GeoHexHTML5勉強会#23_GeoHex
HTML5勉強会#23_GeoHex
 
LUMIA APP LABS: HERE MAPS AND LOCATION APIS FOR WINDOWS PHONE
LUMIA APP LABS: HERE MAPS AND LOCATION APIS FOR WINDOWS PHONELUMIA APP LABS: HERE MAPS AND LOCATION APIS FOR WINDOWS PHONE
LUMIA APP LABS: HERE MAPS AND LOCATION APIS FOR WINDOWS PHONE
 
Android Location-based應用開發分享
Android Location-based應用開發分享Android Location-based應用開發分享
Android Location-based應用開發分享
 
Augmented Reality on iPhone Applications
Augmented Reality on iPhone ApplicationsAugmented Reality on iPhone Applications
Augmented Reality on iPhone Applications
 
Augmented reality
Augmented realityAugmented reality
Augmented reality
 
203 Is It Real or Is It Virtual? Augmented Reality on the iPhone
203 Is It Real or Is It Virtual? Augmented Reality on the iPhone203 Is It Real or Is It Virtual? Augmented Reality on the iPhone
203 Is It Real or Is It Virtual? Augmented Reality on the iPhone
 
Breizhcamp Rennes 2011
Breizhcamp Rennes 2011Breizhcamp Rennes 2011
Breizhcamp Rennes 2011
 
Sirius Web Advanced : Customize and Extend the Platform
Sirius Web Advanced : Customize and Extend the PlatformSirius Web Advanced : Customize and Extend the Platform
Sirius Web Advanced : Customize and Extend the Platform
 
Gestures
GesturesGestures
Gestures
 
CocoaHeads Toulouse - Guillaume Cerquant - UIView
CocoaHeads Toulouse - Guillaume Cerquant - UIViewCocoaHeads Toulouse - Guillaume Cerquant - UIView
CocoaHeads Toulouse - Guillaume Cerquant - UIView
 
Workshop 25: React Native - Components
Workshop 25: React Native - ComponentsWorkshop 25: React Native - Components
Workshop 25: React Native - Components
 
Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...
Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...
Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...
 

Último

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Último (20)

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 

Introduction to MapKit

  • 1. An Intro to MapKit Rob Caporetto @rob_caporetto
  • 4. The Plan What is MapKit? Adding MapKit to your iPhone Application
  • 5. The Plan What is MapKit? Adding MapKit to your iPhone Application Setting the Position
  • 6. The Plan What is MapKit? Adding MapKit to your iPhone Application Setting the Position Annotations
  • 7. The Plan What is MapKit? Adding MapKit to your iPhone Application Setting the Position Annotations Geocoding
  • 8. The Plan What is MapKit? Adding MapKit to your iPhone Application Setting the Position Annotations Geocoding Interacting with Core Location
  • 10. Embed Maps in your App
  • 11.
  • 12. Adding MapKit to your App
  • 13. Adding MapKit to your App Add the Mapkit & CoreLocation frameworks Create a View Controller which implements MKMapViewDelegate Create an MKMapView instance and connect to the controller
  • 14. Setting the Position Set the region property Defines the center point and a span Span defines the vertical & horizontal distance to display
  • 15. Setting the Position - (void)viewDidLoad { MKCoordinateRegion region; region.center.latitude = [eventVenue.latitude doubleValue]; region.center.longitude = [eventVenue.longitude doubleValue]; region.span.latitudeDelta = 0.0039; region.span.longitudeDelta = 0.0034; mapView.region = region; }
  • 17. Annotations Allow you to add places-of-interest to a Map Implemented with a Model & a View
  • 18. Annotation Models Implement the MKAnnotation protocol Exposes a Title, Subtitle, and Coordinate
  • 19.
  • 20. Title
  • 21. Title Subtitle
  • 22. Title Subtitle Coordinate
  • 23. Annotation Views Use MKAnnotationView Easiest trick to set the image property Use MKPinAnnotationView if you want the Pin
  • 24. Managing Annotation Views Managed like UITableViewCells
  • 25. Managing Annotation Views - (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id <MKAnnotation>)annotation { MKPinAnnotationView *annotationView = (MKPinAnnotationView *)([theMapView dequeueReusableAnnotationViewWithIdentifier:@"annotation"]); if (annotationView == NULL) { annotationView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"annotation"] autorelease]; annotationView.canShowCallout = YES; annotationView.animatesDrop = YES; } annotationView.annotation = annotation; return annotationView; }
  • 27. Geocoding Convert Landmarks into Longitude/Latitude and vice-versa SDK 3.0 Supports Reverse Geocoding only
  • 28. Reverse Geocoding Use MKReverseGeocoder Requires network access (Wifi/3G/EDGE) Asynchronous lookups
  • 30. Showing the User’s Location Set the showsUserLocation property on the MapView instance Implement an Annotation
  • 31. Showing the User’s Location - (void)viewDidLoad { // Other initialisation… mapView.showsUserLocation = YES; }
  • 32. Showing the User’s Location - (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id <MKAnnotation>)annotation { // Checks to see if we are going to add the annotation for the users's location. // If this is the case, then we don't bother with creating an annotation and let // the platform give us the blue dot. if (annotation == mapView.userLocation) return nil; // Configuring other annotations… }
  • 33.
  • 34. Resources WWDC 2009: Sessions 118 & 119 LocateMe Sample Application PragProg MapKit Screencast: http://pragprog.com/screencasts/v-bdmapkit

Notas do Editor

  1. Introductions!
  2. NOT A COMPREHENSIVE PRESENTATION, just a brief introduction to what MK is, and some of the basic things which you can do with it. What MapKit provides (if you didn&amp;#x2019;t catch any of the 3.0 media). What you need to do to support it in your iPhone application Setting the position of the map Adding &amp; Managing Annotations Using Core Location to be able to plot the user&amp;#x2019;s current position on screen as well Other hints &amp; tips
  3. NOT A COMPREHENSIVE PRESENTATION, just a brief introduction to what MK is, and some of the basic things which you can do with it. What MapKit provides (if you didn&amp;#x2019;t catch any of the 3.0 media). What you need to do to support it in your iPhone application Setting the position of the map Adding &amp; Managing Annotations Using Core Location to be able to plot the user&amp;#x2019;s current position on screen as well Other hints &amp; tips
  4. NOT A COMPREHENSIVE PRESENTATION, just a brief introduction to what MK is, and some of the basic things which you can do with it. What MapKit provides (if you didn&amp;#x2019;t catch any of the 3.0 media). What you need to do to support it in your iPhone application Setting the position of the map Adding &amp; Managing Annotations Using Core Location to be able to plot the user&amp;#x2019;s current position on screen as well Other hints &amp; tips
  5. NOT A COMPREHENSIVE PRESENTATION, just a brief introduction to what MK is, and some of the basic things which you can do with it. What MapKit provides (if you didn&amp;#x2019;t catch any of the 3.0 media). What you need to do to support it in your iPhone application Setting the position of the map Adding &amp; Managing Annotations Using Core Location to be able to plot the user&amp;#x2019;s current position on screen as well Other hints &amp; tips
  6. NOT A COMPREHENSIVE PRESENTATION, just a brief introduction to what MK is, and some of the basic things which you can do with it. What MapKit provides (if you didn&amp;#x2019;t catch any of the 3.0 media). What you need to do to support it in your iPhone application Setting the position of the map Adding &amp; Managing Annotations Using Core Location to be able to plot the user&amp;#x2019;s current position on screen as well Other hints &amp; tips
  7. NOT A COMPREHENSIVE PRESENTATION, just a brief introduction to what MK is, and some of the basic things which you can do with it. What MapKit provides (if you didn&amp;#x2019;t catch any of the 3.0 media). What you need to do to support it in your iPhone application Setting the position of the map Adding &amp; Managing Annotations Using Core Location to be able to plot the user&amp;#x2019;s current position on screen as well Other hints &amp; tips
  8. Added in 3.0 Embed Google Maps in your app Full UX of Maps application (panning, scrolling, Views etc). Supports regular, satellite, hybrid maps Handles caching, tile loading, memory warnings, connectivity changes
  9. This is a general screenshot from my App. Shows mapview with a single annotation &amp; callout Will explain full process later
  10. Why CL? MK uses some of the CL types. Also may want to integrate CL into your app (eg. showing user&amp;#x2019;s location on a map)
  11. - Region takes an MKCoordinateRegion struct - Centre is the latitude &amp; longitude point which define the location which is centred on screen. - Span defines the zoom level via the lat/long range (in degrees). - Check MKCoordinateSpan in the docs for how it needs to be set (long varies depending on the latitude). - Setting this will have an impact on the zoom level due to all of that - Can adjust the centre position without impacting zoom by setting the centerCoordinate property (takes a CLLocationCoordinate2D type)
  12. - Snippet from my App - 1-2 init MKMapView (via code) - 4-8 set the centre to the location (user value), plus the zoom level. (0.5km lat) - 10 sets the region to our generated one
  13. - Can have any number of annotations on your map
  14. - Coordinate is required (as you need to have a location). - Title &amp; Subtitle are optional (although title is recommended). - T &amp; ST are used as the primary &amp; secondary labels on the default callout