Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close

xkcd #1110 for iOS

Inspired by recent discussions on how long it could take Google to develop standalone Google Maps, I decided to prove my opinion that it should take very, very short time.

So based on the idea from Florian Wesch - @dividuum - and using his tiles for Randall Munroe's xkcd comic #1110): http://xkcd-map.rent-a-geek.de I've decided to develop a small app that would display just the "map" data.

It took me around 3h.

How long would it take Google to add basic search and routing to such a maps app? I estimate it should take them at most, in the worst case scenario, about 3 months to be at the same stage as the pre-iOS 6 Maps app.

Again, that's the worst case scenario, with Google's resources for hiring engineers.

This app uses CATiledLayer and the fact that its -drawInContext: is multithreaded. This means we can even download the tiles during -drawInContext:. To be nicer to Florian's and user's bandwidth, there's also some caching of the downloaded images.

View which contains the CATiledLayer subclass doesn't do anything except contain this special layer. UIScrollView does all the hard work of handling scrolling and zooming, which CATiledLayer happily picks up and orders drawing of its own contents.

This is a universal app for iPhone and iPad. It was tested only in the simulator, and also seems to work fine on simulated iPhone 5.

-- Ivan Vučica ivan@vucica.net

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.