Authored by Thomas Rasch

o Might fix #66 but might also introduce other problems

... ... @@ -962,6 +962,7 @@
[mapScrollView addObserver:self forKeyPath:@"contentOffset" options:NSKeyValueObservingOptionNew context:NULL];
[mapScrollView setZoomScale:exp2f([self zoom]) animated:NO];
[self setDecelerationMode:decelerationMode];
_lastZoom = [self zoom];
... ... @@ -1245,7 +1246,7 @@
if (tileSource == newTileSource)
return;
int previousTileSideLength = [tileSource tileSideLength];
// int previousTileSideLength = [tileSource tileSideLength];
RMProjectedPoint centerPoint = [self centerProjectedPoint];
[tileSource cancelAllDownloads];
... ... @@ -1271,17 +1272,17 @@
[self setMaxZoom:newTileSource.maxZoom];
[self setZoom:[self zoom]]; // setZoom clamps zoom level to min/max limits
if (previousTileSideLength == 0 || previousTileSideLength == [tileSource tileSideLength])
{
// Reload the map with the new tilesource
tiledLayerView.layer.contents = nil;
[tiledLayerView.layer setNeedsDisplay];
}
else
{
// if (previousTileSideLength == 0 || previousTileSideLength == [tileSource tileSideLength])
// {
// // Reload the map with the new tilesource
// tiledLayerView.layer.contents = nil;
// [tiledLayerView.layer setNeedsDisplay];
// }
// else
// {
// Recreate the map layer
[self createMapView];
}
// }
[self setCenterProjectedPoint:centerPoint animated:NO];
}
... ...