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 @@ @@ -79,9 +79,10 @@
79 [super dealloc]; 79 [super dealloc];
80 } 80 }
81 81
82 -- (void)layoutSubviews 82 +- (void)setNeedsDisplay
83 { 83 {
84 self.contentScaleFactor = 1.0f; 84 self.contentScaleFactor = 1.0f;
  85 + [super setNeedsDisplay];
85 } 86 }
86 87
87 -(void)drawRect:(CGRect)rect 88 -(void)drawRect:(CGRect)rect
@@ -1342,7 +1342,15 @@ @@ -1342,7 +1342,15 @@
1342 1342
1343 adjustTilesForRetinaDisplay = doAdjustTilesForRetinaDisplay; 1343 adjustTilesForRetinaDisplay = doAdjustTilesForRetinaDisplay;
1344 1344
1345 - [self createMapView]; 1345 + // Not so good: this replicates functionality from createMapView
  1346 + int tileSideLength = [[self tileSource] tileSideLength];
  1347 +
  1348 + if (adjustTilesForRetinaDisplay && screenScale > 1.0)
  1349 + ((CATiledLayer *)tiledLayerView.layer).tileSize = CGSizeMake(tileSideLength * 2.0, tileSideLength * 2.0);
  1350 + else
  1351 + ((CATiledLayer *)tiledLayerView.layer).tileSize = CGSizeMake(tileSideLength, tileSideLength);
  1352 +
  1353 + [self setCenterCoordinate:self.centerCoordinate animated:NO];
1346 } 1354 }
1347 1355
1348 - (RMProjection *)projection 1356 - (RMProjection *)projection
@@ -27,11 +27,13 @@ @@ -27,11 +27,13 @@
27 - (void)viewDidLoad 27 - (void)viewDidLoad
28 { 28 {
29 [super viewDidLoad]; 29 [super viewDidLoad];
30 - mapView.delegate = self;  
31 30
32 - /* -- Uncomment to constrain view  
33 - [mapView setConstraintsSW:((CLLocationCoordinate2D){-33.942221,150.996094})  
34 - NE:((CLLocationCoordinate2D){-33.771157,151.32019})]; */ 31 +// [mapView setConstraintsSouthWest:CLLocationCoordinate2DMake(47.0, 10.0)
  32 +// northEeast:CLLocationCoordinate2DMake(48.0, 11.0)];
  33 +
  34 + mapView.centerCoordinate = CLLocationCoordinate2DMake(47.56, 10.22);
  35 +// mapView.adjustTilesForRetinaDisplay = YES;
  36 + mapView.delegate = self;
35 37
36 [self updateInfo]; 38 [self updateInfo];
37 } 39 }