Changeset 13861 in josm


Ignore:
Timestamp:
2018-05-28T20:25:58+02:00 (6 years ago)
Author:
wiktorn
Message:

Ensure that tiles from lower zoom leveles are loaded

When lower zoom leveles doesn't have any tiles initiate loading and ensure, that
tiles will be loaded and in tile cache. This tiles will be used to render
imagery when no tiles are availble at current tile zoom level.

Duplicate requests for loading will be handled by TileLoader factories so this
should not generate memory load or unnecessary requests to imagery server.

Closes: #13738, #14562

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r13839 r13861  
    15571557                // Instantiating large TileSets is expensive. If there are no loaded tiles, don't bother even trying.
    15581558                if (ts2.allLoadedTiles().isEmpty()) {
    1559                     newlyMissedTiles.add(missed);
    1560                     continue;
     1559                    if (zoomOffset > 0) {
     1560                        newlyMissedTiles.add(missed);
     1561                        continue;
     1562                    } else {
     1563                        /*
     1564                         *  We have negative zoom offset. Try to load tiles from lower zoom levels, as they may be not present
     1565                         *  in tile cache (e.g. when user panned the map or opened layer above zoom level, for which tiles are present.
     1566                         *  This will ensure, that tileCache is populated with tiles from lower zoom levels so it will be possible to
     1567                         *  use them to paint overzoomed tiles.
     1568                         *  See: #14562
     1569                         */
     1570                        ts2.loadAllTiles(false);
     1571                    }
    15611572                }
    15621573                if (ts2.tooLarge()) {
Note: See TracChangeset for help on using the changeset viewer.