org.openstreetmap.gui.jmapviewer
Class OsmTileLoader

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

public class OsmTileLoader
extends java.lang.Object
implements TileLoader

A TileLoader implementation that loads tiles from OSM via HTTP.

Author:
Jan Peter Stotz

Field Summary
static java.lang.String ACCEPT
           
protected  TileLoaderListener listener
           
private static java.util.logging.Logger log
           
static java.lang.String USER_AGENT
          Holds the used user agent used for HTTP requests.
 
Constructor Summary
OsmTileLoader(TileLoaderListener listener)
           
 
Method Summary
 java.lang.Runnable createTileLoaderJob(TileSource source, int tilex, int tiley, int zoom)
          A typical TileLoader.createTileLoaderJob(org.openstreetmap.gui.jmapviewer.interfaces.TileSource, int, int, int) implementation should create and return a new Runnable instance that performs the load action.
protected  java.net.HttpURLConnection loadTileFromOsm(Tile tile)
           
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

log

private static final java.util.logging.Logger log

USER_AGENT

public static java.lang.String USER_AGENT
Holds the used user agent used for HTTP requests. If this field is null, the default Java user agent is used.


ACCEPT

public static java.lang.String ACCEPT

listener

protected TileLoaderListener listener
Constructor Detail

OsmTileLoader

public OsmTileLoader(TileLoaderListener listener)
Method Detail

createTileLoaderJob

public java.lang.Runnable createTileLoaderJob(TileSource source,
                                              int tilex,
                                              int tiley,
                                              int zoom)
Description copied from interface: TileLoader
A typical TileLoader.createTileLoaderJob(org.openstreetmap.gui.jmapviewer.interfaces.TileSource, int, int, int) implementation should create and return a new Runnable instance that performs the load action.

Specified by:
createTileLoaderJob in interface TileLoader
Returns:
Runnable implementation that performs the desired load action.

loadTileFromOsm

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

prepareHttpUrlConnection

protected void prepareHttpUrlConnection(java.net.HttpURLConnection urlConn)

toString

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