SlideShare uma empresa Scribd logo
1 de 11
Baixar para ler offline
Maps
https://developer.apple.com/maps/
Location and Maps
MapKit API

draw a map, place a pin

Core Location API

GPS, 3G, Wi-Fi
English
latitude, longitude

geometrical location represented by y, x position on the earth.
latitude(N-S), longitude(W-E) e.g. 10.787873, 106.685182

embed, include

embed a map in your app.

locate, nail down the position

locate the line where the exception was thrown.
MapKit API (Demo)
MapKit API

how to draw a map.

how to drop a pin (annotation)
MapKit API
add library
MapKit API
hook up with code
MapKit API
import MapKit
@IBOutLet weak var theMap: MKMapView!
// set the location of the landmark.
var dcCenter = CLLocationCoordinate2DMake(10.787873, 106.685182)
// set the span (scale)
var span = MKCoordinateSpanMake(0.02, 0.02)
// set the region to display w/ location and span.
var region = MKCoordinateRegion(center:dcCenter, span:span)
// set the region to the map.
theMap.setRegion(region, animated:true)
Annotation (Pin)
// create an instance of pin.
var annotation = MKPointAnnotation()
// set the position of the pin.
annotation.coordinate = landmark
// set the title of the pin.
annotation.title = “DC Center”
// add the pin to the map.
theMap.addAnnotation(annotation)
Core Location API (Demo)
Location Manager

how to find out your location? GPS, 3G, Wi-Fi
Core Location
// Implement a protocol
class ViewController: UIViewController, CLLocationManagerDelegate {
// Location Manager
myLocationManager = CLLocationManager()
myLocationManager.delegate = self
myLocationManager.startUpdatingLocation()
// Callback
func locationManager(manager: CLLocationManager!,
didUpdateLocations locations: [AnyObject]!)
{
println(“Lat: (manager.location.coordinate.latitude)")
println(“Lon: (manager.location.coordinate.longitude)")
}
NSLocationAlwaysUsageDescription
Used in Popup Dialog

Mais conteúdo relacionado

Mais procurados

[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
종빈 오
 

Mais procurados (12)

The Web map stack on Django
The Web map stack on DjangoThe Web map stack on Django
The Web map stack on Django
 
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
 
OpenLayers Feature Frenzy
OpenLayers Feature FrenzyOpenLayers Feature Frenzy
OpenLayers Feature Frenzy
 
OpenLayers vs. Leaflet
OpenLayers vs. LeafletOpenLayers vs. Leaflet
OpenLayers vs. Leaflet
 
OL3-Cesium: 3D for OpenLayers maps
OL3-Cesium: 3D for OpenLayers mapsOL3-Cesium: 3D for OpenLayers maps
OL3-Cesium: 3D for OpenLayers maps
 
51811680 open layers
51811680 open layers51811680 open layers
51811680 open layers
 
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
 
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
 
Mapping in Drupal using OpenLayers
Mapping in Drupal using OpenLayersMapping in Drupal using OpenLayers
Mapping in Drupal using OpenLayers
 
Where20 2008 Ruby Tutorial
Where20 2008 Ruby TutorialWhere20 2008 Ruby Tutorial
Where20 2008 Ruby Tutorial
 
[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
 
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
 

Destaque

RESULTS SUMMARY
RESULTS SUMMARYRESULTS SUMMARY
RESULTS SUMMARY
Bekki Tagg
 
LA COGNOTECNOLOGIA
LA COGNOTECNOLOGIALA COGNOTECNOLOGIA
LA COGNOTECNOLOGIA
auridis
 
laundry catalog..compressed
laundry catalog..compressedlaundry catalog..compressed
laundry catalog..compressed
Becky Jiang
 

Destaque (17)

Top 8 health administrator resume samples
Top 8 health administrator resume samplesTop 8 health administrator resume samples
Top 8 health administrator resume samples
 
General merchandise clerk performance appraisal
General merchandise clerk performance appraisalGeneral merchandise clerk performance appraisal
General merchandise clerk performance appraisal
 
I believe
I believeI believe
I believe
 
State life
State lifeState life
State life
 
Auteur Theory
Auteur TheoryAuteur Theory
Auteur Theory
 
RESULTS SUMMARY
RESULTS SUMMARYRESULTS SUMMARY
RESULTS SUMMARY
 
LA COGNOTECNOLOGIA
LA COGNOTECNOLOGIALA COGNOTECNOLOGIA
LA COGNOTECNOLOGIA
 
Basic ceo's tasks for small group
Basic ceo's tasks for small groupBasic ceo's tasks for small group
Basic ceo's tasks for small group
 
The Best Restaurants in Miami
The Best Restaurants in MiamiThe Best Restaurants in Miami
The Best Restaurants in Miami
 
Environment_Francesco_Amendola_2015_combined_CV_PH_0433626007 (3)
Environment_Francesco_Amendola_2015_combined_CV_PH_0433626007 (3)Environment_Francesco_Amendola_2015_combined_CV_PH_0433626007 (3)
Environment_Francesco_Amendola_2015_combined_CV_PH_0433626007 (3)
 
عروض كارفور مصر
عروض كارفور مصرعروض كارفور مصر
عروض كارفور مصر
 
Kecerdasan musikal
Kecerdasan musikalKecerdasan musikal
Kecerdasan musikal
 
Particiones
ParticionesParticiones
Particiones
 
laundry catalog..compressed
laundry catalog..compressedlaundry catalog..compressed
laundry catalog..compressed
 
Title Card Making
Title Card Making Title Card Making
Title Card Making
 
Discovering Key Moments from Social Media Streams
Discovering Key Moments from Social Media StreamsDiscovering Key Moments from Social Media Streams
Discovering Key Moments from Social Media Streams
 
Eco Driving jako skuteczna metoda poszukiwania oszczędności paliwowej
Eco Driving jako skuteczna metoda poszukiwania oszczędności paliwowejEco Driving jako skuteczna metoda poszukiwania oszczędności paliwowej
Eco Driving jako skuteczna metoda poszukiwania oszczędności paliwowej
 

Semelhante a Swift Map

Maps API on_mobile_dev_festbangkok
Maps API on_mobile_dev_festbangkokMaps API on_mobile_dev_festbangkok
Maps API on_mobile_dev_festbangkok
ss318
 
Average- An android project
Average- An android projectAverage- An android project
Average- An android project
Ipsit Dash
 
Hands on with the Google Maps Data API
Hands on with the Google Maps Data APIHands on with the Google Maps Data API
Hands on with the Google Maps Data API
ss318
 
Sapo GIS Hands-On
Sapo GIS Hands-OnSapo GIS Hands-On
Sapo GIS Hands-On
codebits
 
Gis SAPO Hands On
Gis SAPO Hands OnGis SAPO Hands On
Gis SAPO Hands On
codebits
 

Semelhante a Swift Map (20)

Intro To Google Maps
Intro To Google MapsIntro To Google Maps
Intro To Google Maps
 
Maps API on_mobile_dev_festbangkok
Maps API on_mobile_dev_festbangkokMaps API on_mobile_dev_festbangkok
Maps API on_mobile_dev_festbangkok
 
HTML5勉強会#23_GeoHex
HTML5勉強会#23_GeoHexHTML5勉強会#23_GeoHex
HTML5勉強会#23_GeoHex
 
GIS in the Rockies 2011: Building Distributed JavaScript Map Widgets with Ope...
GIS in the Rockies 2011: Building Distributed JavaScript Map Widgets with Ope...GIS in the Rockies 2011: Building Distributed JavaScript Map Widgets with Ope...
GIS in the Rockies 2011: Building Distributed JavaScript Map Widgets with Ope...
 
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...
 
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
 
Average- An android project
Average- An android projectAverage- An android project
Average- An android project
 
ArcGIS API for Javascript Tutorial
ArcGIS API for Javascript TutorialArcGIS API for Javascript Tutorial
ArcGIS API for Javascript Tutorial
 
@Ionic native/google-maps
@Ionic native/google-maps@Ionic native/google-maps
@Ionic native/google-maps
 
INAC Online Hazards Database App
INAC Online Hazards Database AppINAC Online Hazards Database App
INAC Online Hazards Database App
 
Mini project final presentation
Mini project final presentationMini project final presentation
Mini project final presentation
 
Developing Spatial Applications with Google Maps and CARTO
Developing Spatial Applications with Google Maps and CARTODeveloping Spatial Applications with Google Maps and CARTO
Developing Spatial Applications with Google Maps and CARTO
 
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
 
Google Maps API 101
Google Maps API 101Google Maps API 101
Google Maps API 101
 
Easy2park - A smarter way to find a parking lot
Easy2park - A smarter way to find a parking lotEasy2park - A smarter way to find a parking lot
Easy2park - A smarter way to find a parking lot
 
Hands on with the Google Maps Data API
Hands on with the Google Maps Data APIHands on with the Google Maps Data API
Hands on with the Google Maps Data API
 
Location Based Services Without the Cocoa
Location Based Services Without the CocoaLocation Based Services Without the Cocoa
Location Based Services Without the Cocoa
 
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.
 
Sapo GIS Hands-On
Sapo GIS Hands-OnSapo GIS Hands-On
Sapo GIS Hands-On
 
Gis SAPO Hands On
Gis SAPO Hands OnGis SAPO Hands On
Gis SAPO Hands On
 

Mais de Futada Takashi (20)

ES6 ECMA2015
ES6 ECMA2015ES6 ECMA2015
ES6 ECMA2015
 
Swift
SwiftSwift
Swift
 
Aws(sdk)
Aws(sdk)Aws(sdk)
Aws(sdk)
 
Objective c(lang)
Objective c(lang)Objective c(lang)
Objective c(lang)
 
Aws(sns)
Aws(sns)Aws(sns)
Aws(sns)
 
Ionic2
Ionic2Ionic2
Ionic2
 
Ionic3
Ionic3Ionic3
Ionic3
 
Ionic
IonicIonic
Ionic
 
Node js
Node jsNode js
Node js
 
Aws
AwsAws
Aws
 
Scala
ScalaScala
Scala
 
Java8
Java8Java8
Java8
 
Ruby
RubyRuby
Ruby
 
Python
PythonPython
Python
 
Golang
GolangGolang
Golang
 
Bootstrap
BootstrapBootstrap
Bootstrap
 
Coffee script
Coffee scriptCoffee script
Coffee script
 
AngularJS
AngularJSAngularJS
AngularJS
 
English
EnglishEnglish
English
 
Swift study: Closure
Swift study: ClosureSwift study: Closure
Swift study: Closure
 

Último

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Último (20)

WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 

Swift Map

  • 2. Location and Maps MapKit API draw a map, place a pin Core Location API GPS, 3G, Wi-Fi
  • 3. English latitude, longitude geometrical location represented by y, x position on the earth. latitude(N-S), longitude(W-E) e.g. 10.787873, 106.685182 embed, include embed a map in your app. locate, nail down the position locate the line where the exception was thrown.
  • 4. MapKit API (Demo) MapKit API how to draw a map. how to drop a pin (annotation)
  • 6. MapKit API hook up with code
  • 7. MapKit API import MapKit @IBOutLet weak var theMap: MKMapView! // set the location of the landmark. var dcCenter = CLLocationCoordinate2DMake(10.787873, 106.685182) // set the span (scale) var span = MKCoordinateSpanMake(0.02, 0.02) // set the region to display w/ location and span. var region = MKCoordinateRegion(center:dcCenter, span:span) // set the region to the map. theMap.setRegion(region, animated:true)
  • 8. Annotation (Pin) // create an instance of pin. var annotation = MKPointAnnotation() // set the position of the pin. annotation.coordinate = landmark // set the title of the pin. annotation.title = “DC Center” // add the pin to the map. theMap.addAnnotation(annotation)
  • 9. Core Location API (Demo) Location Manager how to find out your location? GPS, 3G, Wi-Fi
  • 10. Core Location // Implement a protocol class ViewController: UIViewController, CLLocationManagerDelegate { // Location Manager myLocationManager = CLLocationManager() myLocationManager.delegate = self myLocationManager.startUpdatingLocation() // Callback func locationManager(manager: CLLocationManager!, didUpdateLocations locations: [AnyObject]!) { println(“Lat: (manager.location.coordinate.latitude)") println(“Lon: (manager.location.coordinate.longitude)") }