Class AbstractTileSourceLayer.TileSet

java.lang.Object
org.openstreetmap.gui.jmapviewer.TileRange
org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer.TileSet
Enclosing class:
AbstractTileSourceLayer<T extends org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource>

protected class AbstractTileSourceLayer.TileSet extends org.openstreetmap.gui.jmapviewer.TileRange
  • Field Details

  • Constructor Details

    • TileSet

      protected TileSet(org.openstreetmap.gui.jmapviewer.TileXY t1, org.openstreetmap.gui.jmapviewer.TileXY t2, int zoom)
    • TileSet

      protected TileSet(org.openstreetmap.gui.jmapviewer.TileRange range)
    • TileSet

      private TileSet()
      null tile set
  • Method Details

    • sanitize

      protected void sanitize()
    • tooSmall

      private boolean tooSmall()
    • tooLarge

      private boolean tooLarge()
    • allExistingTiles

      private List<org.openstreetmap.gui.jmapviewer.Tile> allExistingTiles()
      Get all tiles represented by this TileSet that are already in the tileCache.
      Returns:
      all tiles represented by this TileSet that are already in the tileCache
    • allTilesCreate

      private List<org.openstreetmap.gui.jmapviewer.Tile> allTilesCreate()
    • allTiles

      private List<org.openstreetmap.gui.jmapviewer.Tile> allTiles(Function<TilePosition,org.openstreetmap.gui.jmapviewer.Tile> mapper)
    • tilePositions

      Gets a stream of all tile positions in this set
      Returns:
      A stream of all positions
    • allLoadedTiles

      private List<org.openstreetmap.gui.jmapviewer.Tile> allLoadedTiles()
    • getTileDistanceComparator

      private Comparator<org.openstreetmap.gui.jmapviewer.Tile> getTileDistanceComparator()
      Returns:
      comparator, that sorts the tiles from the center to the edge of the current screen
    • loadAllTiles

      private void loadAllTiles(boolean force)
    • overloadTiles

      private void overloadTiles()
      Extend tile loading corridor, so that no flickering happens when panning
    • loadAllErrorTiles

      private void loadAllErrorTiles(boolean force)
    • visitTiles

      public void visitTiles(Consumer<org.openstreetmap.gui.jmapviewer.Tile> visitor, Consumer<TilePosition> missed)
      Call the given paint method for all tiles in this tile set.

      Uses a parallel stream.

      Parameters:
      visitor - A visitor to call for each tile.
      missed - a consumer to call for each missed tile.
    • visitTilePosition

      private void visitTilePosition(Consumer<org.openstreetmap.gui.jmapviewer.Tile> visitor, TilePosition tp, Consumer<TilePosition> missed)
    • hasVisibleTiles

      public boolean hasVisibleTiles()
      Check if there is any tile fully loaded without error.
      Returns:
      true if there is any tile fully loaded without error
    • hasOverzoomedTiles

      public boolean hasOverzoomedTiles()
      Check if there there is a tile that is overzoomed.

      I.e. the server response for one tile was "there is no tile here". This usually happens when zoomed in too much. The limit depends on the region, so at the edge of such a region, some tiles may be available and some not.

      Returns:
      true if there there is a tile that is overzoomed
    • hasLoadingTiles

      public boolean hasLoadingTiles()
      Check if there are tiles still loading.

      This is the case if there is a tile not yet in the cache, or in the cache but marked as loading (Tile.isLoading().

      Returns:
      true if there are tiles still loading
    • hasAllLoadedTiles

      public boolean hasAllLoadedTiles()
      Check if all tiles in the range are fully loaded.

      A tile is considered to be fully loaded even if the result of loading the tile was an error.

      Returns:
      true if all tiles in the range are fully loaded
    • getTileSetInfo

    • toString

      public String toString()
      Overrides:
      toString in class Object