I have problems loading 512x512 pixels in MKMapKit. The server provides 512x512.jpeg tiles.
I could not find a solution or pattern for custom retinal elements in MKMapView.
What am I doing:
When I load them into MKMapView using
overlay = [[MKTileOverlay alloc] initWithURLTemplate:template]; overlay.tileSize = CGSizeMake(512.0f, 512.0f); [_mapView insertOverlay:overlay atIndex:MAP_OVERLAY_INDEX_TILE level:MKOverlayLevelAboveLabels];
... the tiles are correct, but only half of them are loaded (not only visually - I sniffed the requests, and the fragments disappeared)
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 is 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; }
... overlayRenderer.contentScaleFactor is always 1 ... no matter what tileSize (iOS simulator 7.1 retina)
Any suggestions?
Best regards, Steve
source share