Class AbstractTileSourceLayer.TileSet

    • Constructor Detail

      • 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 Detail

      • 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
      • 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
      • 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.
      • 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