Changeset 36306 in osm for applications


Ignore:
Timestamp:
2024-08-12T18:54:07+02:00 (5 months ago)
Author:
taylor.smock
Message:

Fix #23841: Bing: Automatically reload all tiles with Error: Attribution is not loaded yet after successfully loading the attribution

Location:
applications/viewer/jmapviewer
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer

    • Property ReleaseVersion changed from 2.20 to 2.21
  • applications/viewer/jmapviewer/pom.xml

    r36293 r36306  
    66    <groupId>org.openstreetmap.jmapviewer</groupId>
    77    <artifactId>jmapviewer</artifactId>
    8     <version>2.20</version>
     8    <version>2.22-SNAPSHOT</version>
    99
    1010    <name>JMapViewer</name>
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MemoryTileCache.java

    r36223 r36306  
    22package org.openstreetmap.gui.jmapviewer;
    33
     4import java.util.Collection;
    45import java.util.HashMap;
    56import java.util.Map;
    67import java.util.logging.Level;
    78import java.util.logging.Logger;
     9import java.util.stream.Collectors;
    810
    911import org.openstreetmap.gui.jmapviewer.interfaces.TileCache;
     
    102104        hash.clear();
    103105        lruTiles.clear();
     106    }
     107
     108    @Override
     109    public synchronized void clearErrorTiles() {
     110        Collection<CacheEntry> toRemove = hash.values().stream().filter(cacheEntry -> cacheEntry.tile.hasError()).collect(Collectors.toList());
     111        hash.values().removeAll(toRemove);
     112        toRemove.forEach(lruTiles::removeEntry);
    104113    }
    105114
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/TileCache.java

    r31739 r36306  
    5050
    5151    /**
     52     * Removes error tiles from memory.
     53     * This is implementation specific; the default calls {@link #clear()}.
     54     */
     55    default void clearErrorTiles() {
     56        this.clear();
     57    }
     58
     59    /**
    5260     * Size of the cache.
    5361     * @return maximum number of tiles in cache
Note: See TracChangeset for help on using the changeset viewer.