Open Mapping on iOS
Justin Miller • MapBox
YaC 2013 • Moscow • October 2013
Overview
•What is iOS mapping like out of the box?
•What is geodata? How can you use it?
•What software exists for custom ...
About Me
•I live and work in Portland, USA
•I’ve been building with Cocoa for ~10 years
•I lead iOS & OS X engineering at ...
About MapBox
•We are pushing the space around open data & open source
for maps
•Why? I will show you by way of iOS
•With o...
What Apple GivesYou
•MapKit.framework
•Available since iOS 3 (2009)
•Incrementally improved in each iOS release
•Apple ven...
Inherent Limitations
•No custom styling
•No formal offline capabilities
•Weak interactivity
•Not fine-grained
•Not offline-ca...
What Do We Need?
1.Custom maps
2.Software to integrate them
3.Apple’s blessing
•Alternate frameworks are ok!
•I’ll explain...
Custom Maps
•MapBox is building a cloud platform on OpenStreetMap
•OSM is like Wikipedia for maps
•Over one million contri...
Custom Maps
•We make (and use) TileMill for styling geodata
•TileMill works with both:
• Large (OSM extracts or full)
• Sm...
Can Be Combined!
•Use OSM for the base layer
•Custom (or not) worldwide map
•Use alpha-transparent overlays for details
•B...
But I’m Not a Map Maker!
But I’m Not a Map Maker!
•MapBox provides easy, slider-based styling of
OSM in a web UI
•The point of TileMill is to make ...
Geodata
•Many formats:
•GeoJSON, KML, Shapefile,YMapsML, PostGIS & SQLite
databases, even CSV (+ more)
•You can layer data ...
TileMill Concepts
Geodata
russia.geojson
Import
#russia layer
Export
Russia map image
Code/Style
#russia { ... }
Geodata Import
Export Code/Style
TileMill is Cross-Platform
•Supports OS X,Windows, and Linux
•Also can be run as a web service
•It’s made of Node.js
•Enti...
Maps Produce Tiles
•2D plane: x & y values
•Detail zooming: z value
•Whole world in one tile at z0
•Maybe one city block a...
Tiles Are Numerous
•For zoom level z there are 4z tiles
•Whole world at once: 1 tile (40)
•Whole world by blocks: 417 tile...
MBTiles
•Take many tiles (z, x, y values + image data)
•Stuff them into database rows using SQLite
•Easily compress, trans...
or
What Do We Need?
1.Custom maps ✓
2.Software to integrate them ←
3.Apple’s blessing
Software
•Apple’s MapKit allows tile overlays
•Since iOS 4 (MKOverlay protocol)
•-drawMapRect:... (similar to -drawRect:)
...
So We Built...
•MapBox iOS SDK
•Ground-up workalike of MapKit
•Entirely open source & free
•Fully-featured
Example Usage
•RMMapBoxSource
•[[RMMapBoxSource alloc]
initWithMapID:@”justin.russia”]
•RMMBTilesSource
•[[RMMBTilesSource...
Interactivity
•Simple key/value query on a CGPoint at the current zoom level
•[mapView
formattedOutputOfType:RMInteractive...
•User location tracking
•Expected behavior & gestures
Attention to Detail
•User location tracking
•Expected behavior & gestures
•Ready for iOS 7!
Attention to Detail
One More Thing...
Yet another Thing? ;-)
What Do We Need?
1.Custom maps ✓
2.Software to integrate them ✓
3.Apple’s blessing ←
iOS 7 MapKit
•iOS 7 MapKit lets you bring your own tiles
•Apple’s official blessing of open maps
•And it works on OS X 10.9!
Announcing MBXMapKit
MBXMapKit
•Builds on Apple’s MapKit
•iOS 7+ and OS X 10.9+
•No other dependencies
Simpler Integration
•One class + one line of code!
1. #import <MBXMapKit/MBXMapKit.h>
2. -[MBXMapView initWithFrame:mapID:...
Free & Open Source
•MBXMapKit will continue to evolve
•Will parallel development of our SDK
•This is a great validation by...
Review
•Custom maps from geodata using open source tools
•Native iOS interaction with open source libraries
•Lets you focu...
ThankYou!
•Contact Info
•@incanus77
•justin@mapbox.com
•Software
•github.com/mapbox/mapbox-ios-sdk
•github.com/mapbox/mbxm...
"Open Mapping on iOS". Justin Miller, MapBox
"Open Mapping on iOS". Justin Miller, MapBox
"Open Mapping on iOS". Justin Miller, MapBox
"Open Mapping on iOS". Justin Miller, MapBox
"Open Mapping on iOS". Justin Miller, MapBox
"Open Mapping on iOS". Justin Miller, MapBox
"Open Mapping on iOS". Justin Miller, MapBox
Upcoming SlideShare
Loading in …5
×

"Open Mapping on iOS". Justin Miller, MapBox

1,459 views
1,323 views

Published on

Open mapping refers to using open source software to display and interact with maps and using open source tools and data to make the maps themselves. You will hear about ways to make maps from common data as well as how to use them in both online and offline environments on Apple's iOS ecosystem. We will cover some basic types of geographic data, bringing them all together and designing a map, and working with Apple's closed, proprietary operating system in more flexible and open ways. You will learn about some of the challenges that map-enabled app developers face in a mobile environment and how various open source projects and standards can help solve those problems.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,459
On SlideShare
0
From Embeds
0
Number of Embeds
742
Actions
Shares
0
Downloads
70
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

"Open Mapping on iOS". Justin Miller, MapBox

  1. 1. Open Mapping on iOS Justin Miller • MapBox YaC 2013 • Moscow • October 2013
  2. 2. Overview •What is iOS mapping like out of the box? •What is geodata? How can you use it? •What software exists for custom mapping?
  3. 3. About Me •I live and work in Portland, USA •I’ve been building with Cocoa for ~10 years •I lead iOS & OS X engineering at MapBox
  4. 4. About MapBox •We are pushing the space around open data & open source for maps •Why? I will show you by way of iOS •With open tech, we also leave options open •No inherent lock-in •Mix vendors, software, and data
  5. 5. What Apple GivesYou •MapKit.framework •Available since iOS 3 (2009) •Incrementally improved in each iOS release •Apple vends their own maps •Pre-iOS 6, famously, they vended Google’s
  6. 6. Inherent Limitations •No custom styling •No formal offline capabilities •Weak interactivity •Not fine-grained •Not offline-capable •Not at the pixel level
  7. 7. What Do We Need? 1.Custom maps 2.Software to integrate them 3.Apple’s blessing •Alternate frameworks are ok! •I’ll explain more about this later
  8. 8. Custom Maps •MapBox is building a cloud platform on OpenStreetMap •OSM is like Wikipedia for maps •Over one million contributors •But the open tools also let you self-host •Start small, grow large
  9. 9. Custom Maps •We make (and use) TileMill for styling geodata •TileMill works with both: • Large (OSM extracts or full) • Small (vacation.geojson)
  10. 10. Can Be Combined! •Use OSM for the base layer •Custom (or not) worldwide map •Use alpha-transparent overlays for details •Brought in locally (bundled) or via the cloud (MapBox or other)
  11. 11. But I’m Not a Map Maker!
  12. 12. But I’m Not a Map Maker! •MapBox provides easy, slider-based styling of OSM in a web UI •The point of TileMill is to make everyone a map maker! •Analogy: think about design assets in your application
  13. 13. Geodata •Many formats: •GeoJSON, KML, Shapefile,YMapsML, PostGIS & SQLite databases, even CSV (+ more) •You can layer data together to style a map
  14. 14. TileMill Concepts
  15. 15. Geodata russia.geojson Import #russia layer Export Russia map image Code/Style #russia { ... }
  16. 16. Geodata Import Export Code/Style
  17. 17. TileMill is Cross-Platform •Supports OS X,Windows, and Linux •Also can be run as a web service •It’s made of Node.js •Entirely open source and free •Help us make it great(er)!
  18. 18. Maps Produce Tiles •2D plane: x & y values •Detail zooming: z value •Whole world in one tile at z0 •Maybe one city block at z17
  19. 19. Tiles Are Numerous •For zoom level z there are 4z tiles •Whole world at once: 1 tile (40) •Whole world by blocks: 417 tiles (!) •Transport at any reasonable scale becomes a problem
  20. 20. MBTiles •Take many tiles (z, x, y values + image data) •Stuff them into database rows using SQLite •Easily compress, transport, and bundle
  21. 21. or
  22. 22. What Do We Need? 1.Custom maps ✓ 2.Software to integrate them ← 3.Apple’s blessing
  23. 23. Software •Apple’s MapKit allows tile overlays •Since iOS 4 (MKOverlay protocol) •-drawMapRect:... (similar to -drawRect:) •However, you can’t turn off Apple’s maps* •Loading artifacts under your layer(s) •Network/rendering overhead •Unpredictable caching & rendering
  24. 24. So We Built... •MapBox iOS SDK •Ground-up workalike of MapKit •Entirely open source & free •Fully-featured
  25. 25. Example Usage •RMMapBoxSource •[[RMMapBoxSource alloc] initWithMapID:@”justin.russia”] •RMMBTilesSource •[[RMMBTilesSource alloc] initWithTileSetResource:@”russia” ofType:@”mbtiles”]
  26. 26. Interactivity •Simple key/value query on a CGPoint at the current zoom level •[mapView formattedOutputOfType:RMInteractiveSourceOutputTypeFull forPoint:gesturePoint] •Returns HTML that can be used in UIWebView
  27. 27. •User location tracking •Expected behavior & gestures Attention to Detail
  28. 28. •User location tracking •Expected behavior & gestures •Ready for iOS 7! Attention to Detail
  29. 29. One More Thing...
  30. 30. Yet another Thing? ;-)
  31. 31. What Do We Need? 1.Custom maps ✓ 2.Software to integrate them ✓ 3.Apple’s blessing ←
  32. 32. iOS 7 MapKit •iOS 7 MapKit lets you bring your own tiles •Apple’s official blessing of open maps •And it works on OS X 10.9!
  33. 33. Announcing MBXMapKit
  34. 34. MBXMapKit •Builds on Apple’s MapKit •iOS 7+ and OS X 10.9+ •No other dependencies
  35. 35. Simpler Integration •One class + one line of code! 1. #import <MBXMapKit/MBXMapKit.h> 2. -[MBXMapView initWithFrame:mapID:] or -[MBXMapView initWithFrame:MBTilesPath:]
  36. 36. Free & Open Source •MBXMapKit will continue to evolve •Will parallel development of our SDK •This is a great validation by Apple of the value of open mapping!
  37. 37. Review •Custom maps from geodata using open source tools •Native iOS interaction with open source libraries •Lets you focus on combining great services together
  38. 38. ThankYou! •Contact Info •@incanus77 •justin@mapbox.com •Software •github.com/mapbox/mapbox-ios-sdk •github.com/mapbox/mbxmapkit •tilemill.com •Slides at tinyurl.com/MapBoxYaC13

×