Changeset 10964 in josm for trunk


Ignore:
Timestamp:
2016-09-05T22:47:14+02:00 (8 years ago)
Author:
wiktorn
Message:

Load tiles from lower zoom levels if not all of them are loaded

Closes: #13535

File:
1 edited

Legend:

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

    r10941 r10964  
    15471547        public boolean hasOverzoomedTiles;
    15481548        public boolean hasLoadingTiles;
     1549        public boolean hasAllLoadedTiles;
    15491550    }
    15501551
     
    15571558                result.hasOverzoomedTiles = true;
    15581559            }
     1560            result.hasAllLoadedTiles &= t.isLoaded();
    15591561
    15601562            if (t.isLoaded()) {
     
    16701672        // Too many tiles... refuse to download
    16711673        if (!ts.tooLarge()) {
    1672             //Main.debug("size: " + ts.size() + " spanned: " + ts.tilesSpanned());
     1674            // try to load tiles from desired zoom level, no matter what we will show (for example, tiles from previous zoom level
     1675            // on zoom in)
    16731676            ts.loadAllTiles(false);
    16741677        }
     
    16761679        if (displayZoomLevel != zoom) {
    16771680            ts = dts.getTileSet(displayZoomLevel);
     1681            if (!dts.getTileSetInfo(displayZoomLevel).hasAllLoadedTiles && displayZoomLevel < zoom) {
     1682                /*
     1683                 * if we are showing tiles from lower zoom level, ensure that all tiles are loaded
     1684                 * as they are few, and should not trash the tile cache
     1685                 * This is especially needed when dts.getTileSet(zoom).tooLarge() is true and we are
     1686                 * not loading tiles
     1687                 */
     1688                ts.loadAllTiles(false);
     1689            }
    16781690        }
    16791691
Note: See TracChangeset for help on using the changeset viewer.