org.openstreetmap.gui.jmapviewer
Class OsmTileLoader

java.lang.Object
  extended by org.openstreetmap.gui.jmapviewer.OsmTileLoader
All Implemented Interfaces:
TileLoader
Direct Known Subclasses:
OsmFileCacheTileLoader

public class OsmTileLoader
extends java.lang.Object
implements TileLoader

A TileLoader implementation that loads tiles from OSM.


Field Summary
 java.util.Map<java.lang.String,java.lang.String> headers
          Holds the HTTP headers.
protected  TileLoaderListener listener
           
 int timeoutConnect
           
 int timeoutRead
           
 
Constructor Summary
OsmTileLoader(TileLoaderListener listener)
           
 
Method Summary
 TileJob createTileLoaderJob(Tile tile)
          A typical implementation of this function should create and return a new TileJob instance that performs the load action.
protected  java.net.URLConnection loadTileFromOsm(Tile tile)
           
protected  void loadTileMetadata(Tile tile, java.net.URLConnection urlConn)
           
protected  void prepareHttpUrlConnection(java.net.HttpURLConnection urlConn)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

headers

public java.util.Map<java.lang.String,java.lang.String> headers
Holds the HTTP headers. Insert e.g. User-Agent here when default should not be used.


timeoutConnect

public int timeoutConnect

timeoutRead

public int timeoutRead

listener

protected TileLoaderListener listener
Constructor Detail

OsmTileLoader

public OsmTileLoader(TileLoaderListener listener)
Method Detail

createTileLoaderJob

public TileJob createTileLoaderJob(Tile tile)
Description copied from interface: TileLoader
A typical implementation of this function should create and return a new TileJob instance that performs the load action.

Specified by:
createTileLoaderJob in interface TileLoader
Parameters:
tile - the tile to be loaded
Returns:
TileJob implementation that performs the desired load action.

loadTileFromOsm

protected java.net.URLConnection loadTileFromOsm(Tile tile)
                                          throws java.io.IOException
Throws:
java.io.IOException

loadTileMetadata

protected void loadTileMetadata(Tile tile,
                                java.net.URLConnection urlConn)

prepareHttpUrlConnection

protected void prepareHttpUrlConnection(java.net.HttpURLConnection urlConn)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


JOSM