public void rescaleCache ( final Projection pProjection , final double pNewZoomLevel , final double pOldZoomLevel , final Rect pViewPort ) { if ( TileSystem . getInputTileZoomLevel ( pNewZoomLevel ) == TileSystem . getInputTileZoomLevel ( pOldZoomLevel ) ) { return ; } final long startMs = System . currentTimeMillis ( ) ; if ( Configuration . getInstance ( ) . isDebugTileProviders ( ) ) Log . i ( IMapView . LOGTAG , "rescale tile cache from " + pOldZoomLevel + " to " + pNewZoomLevel ) ; final PointL topLeftMercator = pProjection . toMercatorPixels ( pViewPort . left , pViewPort . top , null ) ; final PointL bottomRightMercator = pProjection . toMercatorPixels ( pViewPort . right , pViewPort . bottom , null ) ; final RectL viewPortMercator = new RectL ( topLeftMercator . x , topLeftMercator . y , bottomRightMercator . x , bottomRightMercator . y ) ; final ScaleTileLooper tileLooper = pNewZoomLevel > pOldZoomLevel ? new ZoomInTileLooper ( ) : new ZoomOutTileLooper ( ) ; tileLooper . loop ( pNewZoomLevel , viewPortMercator , pOldZoomLevel , getTileSource ( ) . getTileSizePixels ( ) ) ; final long endMs = System . currentTimeMillis ( ) ; if ( Configuration . getInstance ( ) . isDebugTileProviders ( ) ) Log . i ( IMapView . LOGTAG , "Finished rescale in " + ( endMs - startMs ) + "ms" ) ; }
Recreate the cache using scaled versions of the tiles currently in it