public abstract class AbstractTileFactory extends TileFactory
AbstractTileFactory
provides
a basic implementation for the TileFactory.Constructor and Description |
---|
AbstractTileFactory(TileFactoryInfo info)
Creates a new instance of DefaultTileFactory using the spcified TileFactoryInfo
|
Modifier and Type | Method and Description |
---|---|
protected Runnable |
createTileRunner(Tile tile)
Subclasses can override this if they need custom TileRunners for some reason
|
void |
dispose()
Disposes this TileFactory
|
protected ExecutorService |
getService()
Subclasses may override this method to provide their own executor services.
|
Tile |
getTile(int x,
int y,
int zoom)
Returns the tile that is located at the given tilePoint
for this zoom.
|
TileCache |
getTileCache() |
void |
promote(Tile tile)
Increase the priority of this tile so it will be loaded sooner.
|
void |
setThreadPoolSize(int size)
Set the number of threads to use for loading the tiles.
|
void |
setTileCache(TileCache cache) |
protected void |
startLoading(Tile tile)
Override this method to load the tile using, for example, an
ExecutorService . |
addTileListener, fireTileLoadedEvent, geoToPixel, getInfo, getMapSize, getTileSize, pixelToGeo, removeTileListener
public AbstractTileFactory(TileFactoryInfo info)
info
- a TileFactoryInfo to configure this TileFactorypublic Tile getTile(int x, int y, int zoom)
getTile
in class TileFactory
x
- the x valuey
- the y valuezoom
- the current zoom levelpublic TileCache getTileCache()
public void setTileCache(TileCache cache)
cache
- the tile cacheprotected ExecutorService getService()
public void dispose()
TileFactory
dispose
in class TileFactory
public void setThreadPoolSize(int size)
size
- the thread pool sizeprotected void startLoading(Tile tile)
TileFactory
ExecutorService
.startLoading
in class TileFactory
tile
- The tile to load.protected Runnable createTileRunner(Tile tile)
tile
- the tile (unused!)public void promote(Tile tile)
tile
- the tileCopyright © 2013. All Rights Reserved.