public class DefaultTileSource extends java.lang.Object implements TileSource
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
apiKey |
protected java.lang.String |
baseUrl |
static int |
DEFAULT_TILE_SIZE |
protected java.lang.String |
name |
Constructor and Description |
---|
DefaultTileSource(java.lang.String name,
java.lang.String base_url) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getApiKey() |
javafx.scene.image.Image |
getAttributionImage() |
java.lang.String |
getAttributionLinkURL() |
java.lang.String |
getAttributionText(int zoom,
Coordinate topLeft,
Coordinate botRight) |
java.lang.String |
getBaseUrl() |
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.
|
java.lang.String |
getTermsOfUseURL() |
java.lang.String |
getTilePath(int zoom,
int tilex,
int tiley) |
int |
getTileSize()
Specifies how large each tile is.
|
java.lang.String |
getTileUrl(int zoom,
int tilex,
int tiley)
Constructs the tile url.
|
boolean |
isAttributionRequired() |
double |
latToTileY(double lat,
int zoom) |
double |
lonToTileX(double lon,
int zoom) |
void |
setApiKey(java.lang.String apiKey) |
void |
setAttributionImage(javafx.scene.image.Image attributionImage) |
void |
setAttributionLinkURL(java.lang.String attributionLinkURL) |
void |
setAttributionRequired(boolean required) |
void |
setAttributionText(java.lang.String attributionText) |
void |
setMaxZoom(int maxZoom) |
protected void |
setMinZoom(int minZoom) |
void |
setTermsOfUserURL(java.lang.String termsOfUserURL) |
void |
setTilePathBuilder(TilePathBuildable tilePathBuilder) |
void |
setUrlBuilder(TileUrlBuildable urlBuilder) |
double |
tileXToLon(int x,
int zoom) |
double |
tileYToLat(int y,
int zoom) |
java.lang.String |
toString() |
public static final int DEFAULT_TILE_SIZE
protected java.lang.String name
protected java.lang.String baseUrl
protected java.lang.String apiKey
public DefaultTileSource(java.lang.String name, java.lang.String base_url)
public java.lang.String getName()
TileSource
getName
in interface TileSource
public int getMaxZoom()
TileSource
TileSource.getMaxZoom()
].getMaxZoom
in interface TileSource
JMapViewer#MAX_ZOOM
public int getMinZoom()
TileSource
getMinZoom
in interface TileSource
public java.lang.String getTilePath(int zoom, int tilex, int tiley)
java.io.IOException
- when subclass cannot return the tile URLpublic void setUrlBuilder(TileUrlBuildable urlBuilder)
public java.lang.String getBaseUrl()
public java.lang.String getTileUrl(int zoom, int tilex, int tiley)
TileSource
getTileUrl
in interface TileSource
public java.lang.String toString()
toString
in class java.lang.Object
public int getTileSize()
TileSource
getTileSize
in interface TileSource
public javafx.scene.image.Image getAttributionImage()
getAttributionImage
in interface TileSource
public void setAttributionImage(javafx.scene.image.Image attributionImage)
public boolean isAttributionRequired()
isAttributionRequired
in interface TileSource
public java.lang.String getAttributionText(int zoom, Coordinate topLeft, Coordinate botRight)
getAttributionText
in interface TileSource
zoom
- The optional zoom level for the view.topLeft
- The top left of the bounding box for attribution.botRight
- The bottom right of the bounding box for attribution.public void setAttributionText(java.lang.String attributionText)
public java.lang.String getAttributionLinkURL()
getAttributionLinkURL
in interface TileSource
public void setAttributionLinkURL(java.lang.String attributionLinkURL)
public java.lang.String getTermsOfUseURL()
getTermsOfUseURL
in interface TileSource
public void setTermsOfUserURL(java.lang.String termsOfUserURL)
public double latToTileY(double lat, int zoom)
latToTileY
in interface TileSource
public double lonToTileX(double lon, int zoom)
lonToTileX
in interface TileSource
public double tileYToLat(int y, int zoom)
tileYToLat
in interface TileSource
public double tileXToLon(int x, int zoom)
tileXToLon
in interface TileSource
protected final void setMinZoom(int minZoom)
public final void setMaxZoom(int maxZoom)
public void setAttributionRequired(boolean required)
protected java.lang.String getApiKey()
public void setApiKey(java.lang.String apiKey)
public void setTilePathBuilder(TilePathBuildable tilePathBuilder)