org.openstreetmap.gui.jmapviewer.tilesources
Class TemplatedTMSTileSource

java.lang.Object
  extended by org.openstreetmap.gui.jmapviewer.tilesources.AbstractTileSource
      extended by org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource
          extended by org.openstreetmap.gui.jmapviewer.tilesources.TMSTileSource
              extended by org.openstreetmap.gui.jmapviewer.tilesources.TemplatedTMSTileSource
All Implemented Interfaces:
Attributed, TileSource

public class TemplatedTMSTileSource
extends TMSTileSource


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.openstreetmap.gui.jmapviewer.interfaces.TileSource
TileSource.TileUpdate
 
Field Summary
static java.lang.String[] ALL_PATTERNS
           
private  java.util.Map<java.lang.String,java.lang.String> headers
           
static java.lang.String PATTERN_HEADER
           
static java.lang.String PATTERN_NEG_Y
           
static java.lang.String PATTERN_SWITCH
           
static java.lang.String PATTERN_X
           
static java.lang.String PATTERN_Y
           
static java.lang.String PATTERN_Y_YAHOO
           
static java.lang.String PATTERN_ZOOM
           
private  java.util.Random rand
           
private  java.lang.String[] randomParts
           
 
Fields inherited from class org.openstreetmap.gui.jmapviewer.tilesources.TMSTileSource
maxZoom, minZoom
 
Fields inherited from class org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource
baseUrl, name
 
Fields inherited from class org.openstreetmap.gui.jmapviewer.tilesources.AbstractTileSource
attributionImage, attributionImageURL, attributionLinkURL, attributionText, termsOfUseText, termsOfUseURL
 
Constructor Summary
TemplatedTMSTileSource(java.lang.String name, java.lang.String url, int maxZoom)
           
TemplatedTMSTileSource(java.lang.String name, java.lang.String url, int minZoom, int maxZoom)
           
 
Method Summary
 java.util.Map<java.lang.String,java.lang.String> getHeaders()
           
 java.lang.String getTileUrl(int zoom, int tilex, int tiley)
          Constructs the tile url.
private  void handleTemplate()
           
 
Methods inherited from class org.openstreetmap.gui.jmapviewer.tilesources.TMSTileSource
getMaxZoom, getMinZoom, getTileUpdate
 
Methods inherited from class org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource
getBaseUrl, getExtension, getName, getTilePath, getTileSize, getTileType, latToTileY, lonToTileX, tileXToLon, tileYToLat, toString
 
Methods inherited from class org.openstreetmap.gui.jmapviewer.tilesources.AbstractTileSource
getAttributionImage, getAttributionImageURL, getAttributionLinkURL, getAttributionText, getTermsOfUseText, getTermsOfUseURL, requiresAttribution, setAttributionImage, setAttributionImageURL, setAttributionLinkURL, setAttributionText, setTermsOfUseText, setTermsOfUseURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rand

private java.util.Random rand

randomParts

private java.lang.String[] randomParts

headers

private java.util.Map<java.lang.String,java.lang.String> headers

PATTERN_ZOOM

public static final java.lang.String PATTERN_ZOOM
See Also:
Constant Field Values

PATTERN_X

public static final java.lang.String PATTERN_X
See Also:
Constant Field Values

PATTERN_Y

public static final java.lang.String PATTERN_Y
See Also:
Constant Field Values

PATTERN_Y_YAHOO

public static final java.lang.String PATTERN_Y_YAHOO
See Also:
Constant Field Values

PATTERN_NEG_Y

public static final java.lang.String PATTERN_NEG_Y
See Also:
Constant Field Values

PATTERN_SWITCH

public static final java.lang.String PATTERN_SWITCH
See Also:
Constant Field Values

PATTERN_HEADER

public static final java.lang.String PATTERN_HEADER
See Also:
Constant Field Values

ALL_PATTERNS

public static final java.lang.String[] ALL_PATTERNS
Constructor Detail

TemplatedTMSTileSource

public TemplatedTMSTileSource(java.lang.String name,
                              java.lang.String url,
                              int maxZoom)

TemplatedTMSTileSource

public TemplatedTMSTileSource(java.lang.String name,
                              java.lang.String url,
                              int minZoom,
                              int maxZoom)
Method Detail

handleTemplate

private void handleTemplate()

getHeaders

public java.util.Map<java.lang.String,java.lang.String> getHeaders()

getTileUrl

public java.lang.String getTileUrl(int zoom,
                                   int tilex,
                                   int tiley)
Description copied from interface: TileSource
Constructs the tile url.

Specified by:
getTileUrl in interface TileSource
Overrides:
getTileUrl in class AbstractTMSTileSource
Returns:
fully qualified url for downloading the specified tile image


JOSM