0

So I am trying to implement the tile overlay for Google Map iOS SDK. I have used MapTiler to generate a map and it saved the tiles in a directory structure with the structure /zoom/x/y.png. Normally When I load an image, all I do is called [UIImage imageName:@""]. But now I need to get the file base of the provided zoom, x, and y coordinate. How do I do that?

harinsa
  • 3,176
  • 5
  • 33
  • 53

2 Answers2

0

What I understand is that you are having all the required images in a directory structure inside your project folder. First step is to drag and add resources directory to the app bundle , like to the supporting files and then choose option "Create Folder References for any added folders" . Then you can call the images in your program like below:

[UIImage imageNamed:@"zoom/x/y"];
Community
  • 1
  • 1
tony m
  • 4,769
  • 1
  • 21
  • 28
0

You can use url Template to load image tiles into the tileoverlay.

 NSString *baseURL = [[[NSBundle mainBundle] bundleURL] absoluteString];
NSString *urlTemplate = [baseURL stringByAppendingString:@"/tiles/{z}/{x}/{y}.png"];
self.tileOverlay = [[MKTileOverlay alloc] initWithURLTemplate:urlTemplate];
Anshad Rasheed
  • 2,526
  • 1
  • 14
  • 32
  • Welcome to StackOverflow! The content behind links can change, so it's better if you can summarize the relevant information in the answer instead. That way, your answer can continue to be helpful to people in the future. – seaotternerd Feb 19 '15 at 06:18