I have issues to load 512x512px tiles in MKMapKit. The Server provides 512x512 .jpeg tiles.
I could not find any solution or sample implementation for custom retina tiles in MKMapView.
What I do:
When I load them into MKMapView with
overlay = [[MKTileOverlay alloc] initWithURLTemplate:template];
overlay.tileSize = CGSizeMake(512.0f, 512.0f);
[_mapView insertOverlay:overlay atIndex:MAP_OVERLAY_INDEX_TILE level:MKOverlayLevelAboveLabels];
… tiles are scaling correct but only half of them is loaded (not only visually - i sniffed the requests and the tiles are missing)
with
overlay = [[MKTileOverlay alloc] initWithURLTemplate:template];
overlay.tileSize = CGSizeMake(256.0f, 256.0f);
[_mapView insertOverlay:overlay atIndex:MAP_OVERLAY_INDEX_TILE level:MKOverlayLevelAboveLabels];
… all tiles are displayed but scaling incorrect
This is my drawing method:
(MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id <MKOverlay>)overlay
{
MKOverlayRenderer *overlayRenderer = nil;
if([overlay isKindOfClass:MKTileOverlay.class])
{
overlayRenderer = [[MKTileOverlayRenderer alloc] initWithTileOverlay:overlay];
}
return overlayRenderer;
}
… the overlayRenderer.contentScaleFactor is always 1 … no matter what tileSize (iOS simulator 7.1 retina)
Any suggestions?
Best regards, Steve