org.openstreetmap.gui.jmapviewer.interfaces
Interface TileCache

All Known Implementing Classes:
MemoryTileCache

public interface TileCache

Implement this interface for creating your custom tile cache for JMapViewer.


Method Summary
 void addTile(Tile tile)
          Adds a tile to the cache.
 Tile getTile(TileSource source, int x, int y, int z)
          Retrieves a tile from the cache if present, otherwise null will be returned.
 int getTileCount()
           
 

Method Detail

getTile

Tile getTile(TileSource source,
             int x,
             int y,
             int z)
Retrieves a tile from the cache if present, otherwise null will be returned.

Parameters:
source - the tile source
x - tile number on the x axis of the tile to be retrieved
y - tile number on the y axis of the tile to be retrieved
z - zoom level of the tile to be retrieved
Returns:
the requested tile or null if the tile is not present in the cache

addTile

void addTile(Tile tile)
Adds a tile to the cache. How long after adding a tile can be retrieved via getTile(TileSource, int, int, int) is unspecified and depends on the implementation.

Parameters:
tile - the tile to be added

getTileCount

int getTileCount()
Returns:
the number of tiles hold by the cache


JOSM