14

I already have a tile source set up for use with the Google Maps JavaScript API. I am trying to translate this for use with the iPhone MapKit. I have correctly implemented the javascript zooming levels into mapkit. Whenever - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated is called, I snap the region to the nearest zoom level based on the same center point.

Is it possible to implement a solution possibly with CATiledLayer to implement a tiling solution. Does the iPhone use the standard 256x256 tiles like google maps does natively? Any direction or help on this would be greatly appreciated. I would rather not waste a couple weeks trying to implement this if it's not possible.

rickharrison
  • 4,867
  • 4
  • 35
  • 40
  • 1
    Would you mind elaborating further on how you ended up accomplishing this? I'm trying to do the same exact thing. – Zack Angelo Apr 22 '10 at 14:40

3 Answers3

12

FWIW, I spent quite a bit of time looking for a decent solution… before diving into a CATiledLayer example, I noticed MKOverlay and MKOverlayView — which are new in iOS 4 and plug right into a MKMapView.

Couldn’t find a good example implementation of using MKOverlays that pull arbitrary image data (say, UIImages from a remote tile server), but I tinkered around with the API enough until I got it working.

Built a simple example implementation of it in case anyone (like me) wants a reference:

http://github.com/mtigas/iOS-MapLayerDemo

Hope this helps someone out in the future.

Mike Tigas
  • 199
  • 2
  • 4
5

MapKit doesn't provide much in the way of custom tile sources (in fact, it provides absolutely nothing to customize sources: you either use Google Maps or you don't). I've been working with a similar problem myself, though, and I've found RouteMe to be a pretty good solution for custom maps: http://code.google.com/p/route-me/

Built-in support exists for OpenStreetMaps, OpenAerialMaps (which is currently offline), Virtual Earth, and Yahoo Maps, but the framework makes it pretty easy to plug in your own tile source, too.

JonathonW
  • 857
  • 7
  • 17
  • I appreciate the answer. I actually have a tiling solution now working based on MapKit. My solution actually requires a mapping provider as I just have overlays. If something happens, I will look into using route-me with Yahoo Maps. – rickharrison Mar 22 '10 at 03:21