• Stars
    star
    197
  • Rank 197,722 (Top 4 %)
  • Language
    Objective-C
  • License
    BSD 2-Clause "Sim...
  • Created over 14 years ago
  • Updated over 12 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Demo of using MKOverlayView in iOS 4.0+ to render custom tile server overlays. (Last updated in 2012, you probably want to look elsewhere for modern code examples.)

iOS Custom Map Layer Example

A barebones demo app that demonstrates the use of some new MapKit functionality in iOS 4.0.:

The MKOverlay protocol and MKOverlayView class and how to use these to render custom tile layers a la Google Maps API. (i.e. Google Maps-compatible tile layers from Mapnik/Tilecache, gheat, etc.) Examples include tilesets from OpenStreetMap and MapBox.

(Caveat: the OpenStreetMap renders opaquely over the default Google layer, it does not replace it.)

Comments and feedback are welcome.

  

What?

I refactored django-gheat as a side project and I’ve been working on iOS development a bit lately and was seeking a slick way to plug the django-gheat demo tileserver into the iPhone. The Google Maps API just doesn’t have enough performance in the browser to make for a decent user experience.

Some conversation threads recommended combining a UIScrollView with CATiledLayer, but this seemed unwieldy to couple with the existing MapKit framework.

Lo and behold, iOS 4.0 added custom overlay functionality to MapKit, though I have not seen any mention or example of it’s use to date.

Notes

The code is generally commented thoroughly. I am not an expert in cartography, so my knowledge of map projections and some of the calculations within the code are to be taken with a grain of salt.

CustomOverlayView compensates for [[UIScreen mainScreen] scale], or the iPhone 4’s pixel doubling. The view applies the screen scale factor, creating a situation as if the screen were twice as large. Because MapKit loads pixel-doubled tiles but maintains the same viewport, CustomOverlayView renders tiles of the next (or scale-appropriate) zoom level to maintain a one-to-one mapping with MapKit’s own tiles.

The [MKOverlayView -canDrawMapRect…] and [MKOverlayView -drawMapRect…] methods rely on asynchronously downloading tiles as requested (by -canDrawMapRect) into cache, and then using that cache in the -drawMapRect method after the success callback notifies MapKit to try the tile again.

More Repositories

1

django-medusa

A super simple "static site generator" Django app. (Unmaintained: see README for alternatives.)
Python
333
star
2

django-twofactor

Two factor auth using the TOTP draft spec. Compatible with the Google Authenticator or any other TOTP token. (Unmaintained, last updated in 2013.)
Python
63
star
3

iObfs

obfs4proxy for Onion Browser & other Tor iOS apps --- DEPRECATED AND SUPERSEDED BY @tladesignz/IPtProxy
Objective-C
39
star
4

heroku-django-demo-app

A demo Django-on-Heroku app.
Python
21
star
5

simurgh

A ADS-B "BEAST" TCP decoder server, in Go. Requires dump1090 or similar application with BEAST TCP output. •••••• THIS REPO LIVES AT THE FOLLOWING URL NOW: https://0xacab.org/mtigas/simurgh • or via tor: http://wmj5kiic7b6kjplpbvwadnht2nh2qnkbnqtcv3dyvpqtz7ssbssftxid.onion/mtigas/simurgh
Go
15
star
6

homebrew-tor

Homebrew formulae for Tor and related. (for "brew tap")
Ruby
12
star
7

iOS-BLE-Tire-Logger

THIS REPO LIVES AT THE FOLLOWING URL NOW: https://0xacab.org/mtigas/iOS-BLE-Tire-Logger •••••• or via tor: http://wmj5kiic7b6kjplpbvwadnht2nh2qnkbnqtcv3dyvpqtz7ssbssftxid.onion/mtigas/iOS-BLE-Tire-Logger
Swift
7
star
8

homebrew-ssldump

SSLdump tool, with some patches to fix compatibility w/OpenSSL
Ruby
5
star
9

cs4970_capstone

Fall 2009 capstone project: A Django-based data app using massive amounts of Census & FBI data.
Python
5
star
10

homebrew-gpg21

LEGACY REPO, NO LONGER SUPPORTED. Use `gnupg21` in `homebrew-versions`.
5
star
11

minutiae

A (rather simple) Django-based blog.
Python
4
star
12

air-playground

I toyed with HTML-based Adobe AIR for a while and this is what I came up with.
JavaScript
3
star
13

radiowut

various fun tinkerings with the Rdio API
Python
3
star
14

hello-propubdata

A GitHub Pages demo for the ProPublica Data Institute
3
star
15

django-gpg-sign-middleware

Django middleware that automatically clearsigns HTML pages with PGP. •••••• THIS REPO LIVES AT THE FOLLOWING URL NOW: https://0xacab.org/mtigas/django-gpg-sign-middleware • or via tor: http://wmj5kiic7b6kjplpbvwadnht2nh2qnkbnqtcv3dyvpqtz7ssbssftxid.onion/mtigas/django-gpg-sign-middleware
Python
3
star
16

hello-django

A super-minimal Django "hello world" example repo.
Python
2
star
17

django-harderhash

A port of django-bcrypt that doesn't use bcrypt, but a slow loop of sha384. Don't use this.
Python
2
star
18

django-hellban

Inspired by drupal-misery and Jeff Atwood's "Suspension, Ban or Hellban" blog post
Python
1
star
19

arch-aur-tor-browser-dev

UNMAINTAINED (was repo mirror for the `tor-browser-dev` Arch Linux AUR pkg)
Shell
1
star
20

nyu2017-week2-collab

learning how to collaborate with some github pages fun
HTML
1
star
21

example_code

How-to's and code examples, usually tied in with my blog.
Python
1
star
22

2015.mozfest.club

CSS
1
star
23

geopy

DOES NOT LIVE HERE ANYMORE: Official github mirror is now at https://github.com/geopy/geopy
Python
1
star
24

hidserv-proxy

Forked from SecureDrop's bootstrap bits. Builds a hardened machine, bootstrapped to provide a tor hidden service proxy to a normal website.
Ruby
1
star