SlideShare una empresa de 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

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Similar 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
 

Similar 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

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
 
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
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
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
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Último (20)

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
 
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
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
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
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

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 del 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