Reputation: 4452
I want to use custom map tiles of 512x512 pixels with the MKTileOverlay/MKTileOverlayRenderer. My custom MKTileOverlayRenderer which draws each frame's border looks as follows:
-(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 this way:
self.tileOverlay.tileSize = CGSizeMake(512, 512);
This works fine for tile sizes of for instance 128 or 256. But for a size of 512 (or greater) there is "unused" space between each tile and the tile size remains at 256 pixels as shown in this picture:
How can I draw the full 512 pixel tile?
Upvotes: 3
Views: 650