Introduction to
Geolocation & Apple’s
Maps API

Julian Król
iOS Software Engineer @ MiQUiDO
!1
Geolocation

How to locate user with the Apple’s device?

!2
@import CoreLocation
•

location basis

•

Standard Locating vs Significant change location service

•

accuracy vs perform...
Accuracy vs Performance
Source

Accuracy

Power

Speed

Celluar

Low

Low

Fast

Wi-Fi

Medium

Medium

Normal

GPS

High
...
locationManager.desiredAccuracy

•

kCLLocationAccuracyBestForNavigation

•

kCLLocationAccuracyBest

•

kCLLocationAccura...
Location Service Constraint
•

always check availability of the service
([CLLocationManager locationServicesEnabled])

•

...
The Significant-Change Location Service

•

low power way of tracking location changes

•

requires built-in cellular radio...
Region Monitoring
•

you can not monitor infinite number of regions

•

number of monitored regions is limited for the
app ...
Time for code show
Code for this presentation is available on GitHub:
https://github.com/JulianKrol/maps_presentation

!9
Enough! Move one… Maps API!

!10
@import MapKit

Add map view to your app and check this out:
mapView.showsUserLocation = YES;

!11
MKAnnotation protocol
•

coordinate (required)

•

title (optional)

•

subtitle (optional)

!12
Almighty
MKOverlayRenderer
•

draws a visual effect of an overlay it contain
(id<MKOverlay>)

•

subclasses overrides
draw...
Let’s travel a bit…

!14
More info about Maps
•

https://developer.apple.com/library/ios/
documentation/userexperience/conceptual/
LocationAwarenes...
For even more involved
•

Google Maps for iOS https://developers.google.com/maps/
documentation/ios/

•

MapQuest http://d...
Questions?
!17
Upcoming SlideShare
Loading in...5
×

Introduction to the geolocation & Apple's maps API

1,224
-1

Published on

It's a short presentation (which can be treated as an introduction to the topic) about geolocation and Apple's maps API.

Published in: Technology, Business
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,224
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
19
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Introduction to the geolocation & Apple's maps API

  1. 1. Introduction to Geolocation & Apple’s Maps API Julian Król iOS Software Engineer @ MiQUiDO !1
  2. 2. Geolocation How to locate user with the Apple’s device? !2
  3. 3. @import CoreLocation • location basis • Standard Locating vs Significant change location service • accuracy vs performance • constraints !3
  4. 4. Accuracy vs Performance Source Accuracy Power Speed Celluar Low Low Fast Wi-Fi Medium Medium Normal GPS High High Slow !4
  5. 5. locationManager.desiredAccuracy • kCLLocationAccuracyBestForNavigation • kCLLocationAccuracyBest • kCLLocationAccuracyNearestTenMeters • kCLLocationAccuracyHundredMeters • kCLLocationAccuracyKilometer • kCLLocationAccuracyThreeKilometers !5
  6. 6. Location Service Constraint • always check availability of the service ([CLLocationManager locationServicesEnabled]) • also take a look at authorization status ([CLLocationManager authorizationStatus]) • if app requires retrieving location add UIRequiredDeviceCapabilities key to Info.plist (value location-services and/or gps) !6
  7. 7. The Significant-Change Location Service • low power way of tracking location changes • requires built-in cellular radio • availability starts from iOS 4 !7
  8. 8. Region Monitoring • you can not monitor infinite number of regions • number of monitored regions is limited for the app to 20 • notifications on enter and exit region • margin distance before notifying about entering/ exiting a region !8
  9. 9. Time for code show Code for this presentation is available on GitHub: https://github.com/JulianKrol/maps_presentation !9
  10. 10. Enough! Move one… Maps API! !10
  11. 11. @import MapKit Add map view to your app and check this out: mapView.showsUserLocation = YES; !11
  12. 12. MKAnnotation protocol • coordinate (required) • title (optional) • subtitle (optional) !12
  13. 13. Almighty MKOverlayRenderer • draws a visual effect of an overlay it contain (id<MKOverlay>) • subclasses overrides drawMapRect:zoomScale:inContext: • has a few subclasses (MKTileOverlayRenderer, MKOverlayPathRenderer —> three more) !13
  14. 14. Let’s travel a bit… !14
  15. 15. More info about Maps • https://developer.apple.com/library/ios/ documentation/userexperience/conceptual/ LocationAwarenessPG/MapKit/MapKit.html • https://www.captechconsulting.com/blog/ericstroh/ios-7-tutorial-series-map-kit • https://developer.apple.com/library/ios/ documentation/userexperience/conceptual/ LocationAwarenessPG/AnnotatingMaps/ AnnotatingMaps.html !15
  16. 16. For even more involved • Google Maps for iOS https://developers.google.com/maps/ documentation/ios/ • MapQuest http://developer.mapquest.com • Spatial database (example) http://postgis.net !16
  17. 17. Questions? !17
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×