org.openstreetmap.gui.jmapviewer.interfaces
Interface TileSource

All Superinterfaces:
Attributed
All Known Implementing Classes:
AbstractMapQuestTileSource, AbstractOsmTileSource, AbstractTileSource, AbstractTMSTileSource, BingAerialTileSource, MapQuestOpenAerialTileSource, MapQuestOsmTileSource, OsmTileSource.CycleMap, OsmTileSource.Mapnik, ScanexTileSource, SlippyMapBBoxChooser.RenamedSourceDecorator, TemplatedTMSTileSource, TMSLayer.CachedAttributionBingAerialTileSource, TMSTileSource

public interface TileSource
extends Attributed


Nested Class Summary
static class TileSource.TileUpdate
          Specifies the different mechanisms for detecting updated tiles respectively only download newer tiles than those stored locally.
 
Method Summary
 int getMaxZoom()
          Specifies the maximum zoom value.
 int getMinZoom()
          Specifies the minimum zoom value.
 java.lang.String getName()
          A tile layer name has to be unique and has to consist only of characters valid for filenames.
 int getTileSize()
          Specifies how large each tile is.
 java.lang.String getTileType()
          Specifies the tile image type.
 TileSource.TileUpdate getTileUpdate()
           
 java.lang.String getTileUrl(int zoom, int tilex, int tiley)
          Constructs the tile url.
 double latToTileY(double lat, int zoom)
           
 double lonToTileX(double lon, int zoom)
           
 double tileXToLon(int x, int zoom)
           
 double tileYToLat(int y, int zoom)
           
 
Methods inherited from interface org.openstreetmap.gui.jmapviewer.interfaces.Attributed
getAttributionImage, getAttributionImageURL, getAttributionLinkURL, getAttributionText, getTermsOfUseText, getTermsOfUseURL, requiresAttribution
 

Method Detail

getMaxZoom

int getMaxZoom()
Specifies the maximum zoom value. The number of zoom levels is [0.. getMaxZoom()].

Returns:
maximum zoom value that has to be smaller or equal to JMapViewer.MAX_ZOOM

getMinZoom

int getMinZoom()
Specifies the minimum zoom value. This value is usually 0. Only for maps that cover a certain region up to a limited zoom level this method should return a value different than 0.

Returns:
minimum zoom value - usually 0

getTileUpdate

TileSource.TileUpdate getTileUpdate()
Returns:
The supported tile update mechanism
See Also:
TileSource.TileUpdate

getName

java.lang.String getName()
A tile layer name has to be unique and has to consist only of characters valid for filenames.

Returns:
Name of the tile layer

getTileUrl

java.lang.String getTileUrl(int zoom,
                            int tilex,
                            int tiley)
                            throws java.io.IOException
Constructs the tile url.

Parameters:
zoom -
tilex -
tiley -
Returns:
fully qualified url for downloading the specified tile image
Throws:
java.io.IOException

getTileType

java.lang.String getTileType()
Specifies the tile image type. For tiles rendered by Mapnik or Osmarenderer this is usually "png".

Returns:
file extension of the tile image type

getTileSize

int getTileSize()
Specifies how large each tile is.

Returns:
The size of a single tile in pixels.

latToTileY

double latToTileY(double lat,
                  int zoom)

lonToTileX

double lonToTileX(double lon,
                  int zoom)

tileYToLat

double tileYToLat(int y,
                  int zoom)

tileXToLon

double tileXToLon(int x,
                  int zoom)


JOSM