Authored by Thomas Rasch

o Set the contentScaleFactor for the map tiled layer before every view update (s…

…hould fix #33 and #34)
... ... @@ -79,9 +79,10 @@
[super dealloc];
}
- (void)layoutSubviews
- (void)setNeedsDisplay
{
self.contentScaleFactor = 1.0f;
[super setNeedsDisplay];
}
-(void)drawRect:(CGRect)rect
... ...
... ... @@ -1342,7 +1342,15 @@
adjustTilesForRetinaDisplay = doAdjustTilesForRetinaDisplay;
[self createMapView];
// Not so good: this replicates functionality from createMapView
int tileSideLength = [[self tileSource] tileSideLength];
if (adjustTilesForRetinaDisplay && screenScale > 1.0)
((CATiledLayer *)tiledLayerView.layer).tileSize = CGSizeMake(tileSideLength * 2.0, tileSideLength * 2.0);
else
((CATiledLayer *)tiledLayerView.layer).tileSize = CGSizeMake(tileSideLength, tileSideLength);
[self setCenterCoordinate:self.centerCoordinate animated:NO];
}
- (RMProjection *)projection
... ...
... ... @@ -27,11 +27,13 @@
- (void)viewDidLoad
{
[super viewDidLoad];
mapView.delegate = self;
/* -- Uncomment to constrain view
[mapView setConstraintsSW:((CLLocationCoordinate2D){-33.942221,150.996094})
NE:((CLLocationCoordinate2D){-33.771157,151.32019})]; */
// [mapView setConstraintsSouthWest:CLLocationCoordinate2DMake(47.0, 10.0)
// northEeast:CLLocationCoordinate2DMake(48.0, 11.0)];
mapView.centerCoordinate = CLLocationCoordinate2DMake(47.56, 10.22);
// mapView.adjustTilesForRetinaDisplay = YES;
mapView.delegate = self;
[self updateInfo];
}
... ...