Using a custom map with MKMapKit

I am creating an iPhone application for OS4.0 and I am trying to integrate a custom map with standard MKMapView. I was provided with a map in .eps format (vector image), and I want to somehow overlay this on MKMapView and limit the scroll borders of the map so that users can not scroll outside the borders of the user map. What is the best way to do this?

I read something about placing map tiles on the server, but this seems too complicated for my application. It would just be a map for attraction, about the size of a public zoo, so I would have thought it would be possible to just convert .eps to a .png file and overlay it, but that might not give the best performance.

I understand that I could use UIScrollView to do the job, but the problem is that I have dynamically created MKPinAnnotationViews placed on a map whose position should be based on latitude and longitude, so I can’t think of an elegant or reasonable way to do this is using scrollview. Any ideas?

Thank! Matt

+3
source share
1 answer

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

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

Apple - HazardMap, SDK.

+3

Source: https://habr.com/ru/post/1768353/


All Articles