SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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...
 

Kürzlich hochgeladen

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 

Kürzlich hochgeladen (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 

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

Hinweis der Redaktion

  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