Changeset 17516 in josm
- Timestamp:
- 2021-02-21T23:50:53+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r17509 r17516 641 641 /** 642 642 * As we can see part of the tile at the top and at the bottom, use Math.ceil(...) + 1 to accommodate for that 643 * Add another 2 tiles on each axis, as overloadTiles adds one tile in each direction that might be overloaded644 *645 * @see #overloadTiles()646 643 */ 647 int maxYtiles = (int) Math.ceil((double) height / tileSize + 1) + 2;648 int maxXtiles = (int) Math.ceil((double) width / tileSize + 1) + 2;644 int maxYtiles = (int) Math.ceil((double) height / tileSize + 1); 645 int maxXtiles = (int) Math.ceil((double) width / tileSize + 1); 649 646 int visibileTiles = maxXtiles * maxYtiles; 650 647 /** 651 * Take into account ZOOM_OFFSET to calculate real number of tiles and multiply by 8, to cover all tiles, that might be648 * Take into account ZOOM_OFFSET to calculate real number of tiles and multiply by 7, to cover all tiles, that might be 652 649 * accessed when looking for tiles outside current zoom level. 653 650 * 654 * The value should be sum(2^x for x in (-5 to 2))651 * Currently we use otherZooms = {1, 2, -1, -2, -3, -4, -5} 655 652 * 656 * Currently we use otherZooms = {1, 2, -1, -2, -3, -4, -5} 653 * The value should be sum(2^x for x in (-5 to 2)) - 1 654 * -1 to exclude current zoom level 657 655 * 658 656 * Check call to tryLoadFromDifferentZoom … … 660 658 * @see #drawInViewArea((Graphics2D, MapView, ProjectionBounds) 661 659 * 660 * Add +2 to maxYtiles / maxXtiles to add space in cache for extra tiles in current zoom level that are 661 * download by overloadTiles(). This is not added in computation of visibileTiles as this unnecessarily grow the cache size 662 * @see #overloadTiles() 662 663 */ 663 664 int ret = (int) Math.ceil( 664 Math.pow(2d, ZOOM_OFFSET.get()) * visibileTiles// use offset to decide, how many tiles are visible665 * 8);666 Logging.info("AbstractTileSourceLayer: estimatedtilesproccessed on current zoom level: {0}, estimated cache size: {1}",667 665 Math.pow(2d, ZOOM_OFFSET.get()) * // use offset to decide, how many tiles are visible 666 visibileTiles * 7 + // 7 to cover tiles from other zooms as described above 667 ((maxYtiles + 2) * (maxXtiles +2))); // to add as many tiles as they will be accessed on current zoom level 668 Logging.info("AbstractTileSourceLayer: estimated visibile tiles: {0}, estimated cache size: {1}", visibileTiles, ret); 668 669 return ret; 669 670 }
Note:
See TracChangeset
for help on using the changeset viewer.