public class OsmTileLoader extends Object implements TileLoader
TileLoader
implementation that loads tiles from OSM.Modifier and Type | Class and Description |
---|---|
private class |
OsmTileLoader.OsmTileJob |
Modifier and Type | Field and Description |
---|---|
Map<String,String> |
headers
Holds the HTTP headers.
|
private static Executor |
jobDispatcher |
protected TileLoaderListener |
listener |
int |
timeoutConnect |
int |
timeoutRead |
Constructor and Description |
---|
OsmTileLoader(TileLoaderListener listener) |
OsmTileLoader(TileLoaderListener listener,
Map<String,String> headers) |
Modifier and Type | Method and Description |
---|---|
void |
cancelOutstandingTasks()
cancels all outstanding tasks in the queue.
|
TileJob |
createTileLoaderJob(Tile tile)
A typical implementation of this function should create and return a
new
TileJob instance that performs the load action. |
protected URLConnection |
loadTileFromOsm(Tile tile) |
protected void |
loadTileMetadata(Tile tile,
URLConnection urlConn) |
protected void |
prepareHttpUrlConnection(HttpURLConnection urlConn) |
String |
toString() |
private static final Executor jobDispatcher
public Map<String,String> headers
public int timeoutConnect
public int timeoutRead
protected TileLoaderListener listener
public OsmTileLoader(TileLoaderListener listener)
public OsmTileLoader(TileLoaderListener listener, Map<String,String> headers)
public TileJob createTileLoaderJob(Tile tile)
TileLoader
TileJob
instance that performs the load action.createTileLoaderJob
in interface TileLoader
tile
- the tile to be loadedTileJob
implementation that performs the desired load
action.protected URLConnection loadTileFromOsm(Tile tile) throws IOException
IOException
protected void loadTileMetadata(Tile tile, URLConnection urlConn)
protected void prepareHttpUrlConnection(HttpURLConnection urlConn)
public void cancelOutstandingTasks()
TileLoader
cancelOutstandingTasks
in interface TileLoader