IOS7: MKTileOverlayRenderer with tile size greater than 256

I want to use custom 512x512px map slices using MKTileOverlay / MKTileOverlayRenderer. My custom MKTileOverlayRenderer that draws each frame border looks like this:

-(void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context
{
    CGRect rect = [self rectForMapRect:mapRect];
    CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor);
    CGContextSetLineWidth(context, 1.0/zoomScale);
    CGContextStrokeRect(context, rect);
}

      

The tile size is set as follows:

self.tileOverlay.tileSize = CGSizeMake(512, 512);

      

This is great for tile sizes like 128 or 256. But for a size of 512 (or larger) there is "unused" space between each tile, and the tile size remains at 256 pixels, as shown in this image:

Tile size of 512 pixel

How can I draw a full 512 pixel slab?

+3


source to share





All Articles