Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using custom map with MKMapKit

I am creating an iPhone app for OS4.0, and I am attempting to integrate a custom map with a standard MKMapView. I have been provided a map in .eps format (vector image), and I want to somehow overlay this on an MKMapView in and restrict the scrolling boundaries of the map so users cannot scroll outside the boundaries of the custom map. What's the best way to go about this?

I have read some stuff about hosting map tiles on a server, but this seems overly complex for my application. This would just be a map for an attraction roughly the size of a public zoo, so I would think that it would be conceivable to just convert the .eps to a .png file, and overlay it, but this might not give the best performance.

I understand that I could conceivable use a UIScrollView to do the job, but the problem is that I have dynamically generated MKPinAnnotationViews placed on the map, whose position must be based on latitude and longitude, so I can't think on an elegant or reasonable way to do it with a scrollview. Any ideas?

Thanks! -Matt

like image 545
mag725 Avatar asked Dec 16 '25 22:12

mag725


1 Answers

Apple has a great bit of example code that will show you what you need to do. Check out the TileMap sample - it is available as part of the (free) WWDC 2010 samples download.

It shows you how to use the gdal2tiles utility to convert an input map into a tree of overlay tiles.

Another good bit of Apple sample code to check out is HazardMap, which is part of the regular SDK samples.

like image 176
radven Avatar answered Dec 19 '25 14:12

radven