org.openstreetmap.gui.jmapviewer.tilesources
Class AbstractOsmTileSource
java.lang.Object
org.openstreetmap.gui.jmapviewer.tilesources.AbstractTileSource
org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource
org.openstreetmap.gui.jmapviewer.tilesources.AbstractOsmTileSource
- All Implemented Interfaces:
- Attributed, TileSource
- Direct Known Subclasses:
- AbstractMapQuestTileSource, OsmTileSource.CycleMap, OsmTileSource.Mapnik
public abstract class AbstractOsmTileSource
- extends AbstractTMSTileSource
Methods inherited from class org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource |
getBaseUrl, getExtension, getMinZoom, getName, getTilePath, getTileSize, getTileType, getTileUrl, latToTileY, lonToTileX, tileXToLon, tileYToLat, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AbstractOsmTileSource
public AbstractOsmTileSource(java.lang.String name,
java.lang.String base_url)
getMaxZoom
public int getMaxZoom()
- Description copied from interface:
TileSource
- Specifies the maximum zoom value. The number of zoom levels is [0..
TileSource.getMaxZoom()
].
- Specified by:
getMaxZoom
in interface TileSource
- Overrides:
getMaxZoom
in class AbstractTMSTileSource
- Returns:
- maximum zoom value that has to be smaller or equal to
JMapViewer.MAX_ZOOM
requiresAttribution
public boolean requiresAttribution()
- Specified by:
requiresAttribution
in interface Attributed
- Overrides:
requiresAttribution
in class AbstractTileSource
- Returns:
- True if the tile source requires attribution in text or image form.
getAttributionText
public java.lang.String getAttributionText(int zoom,
Coordinate topLeft,
Coordinate botRight)
- Specified by:
getAttributionText
in interface Attributed
- Overrides:
getAttributionText
in class AbstractTileSource
- Parameters:
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.
- Returns:
- Attribution text for the image source.
getAttributionLinkURL
public java.lang.String getAttributionLinkURL()
- Specified by:
getAttributionLinkURL
in interface Attributed
- Overrides:
getAttributionLinkURL
in class AbstractTileSource
- Returns:
- The URL to open when the user clicks the attribution text.
getAttributionImage
public java.awt.Image getAttributionImage()
- Specified by:
getAttributionImage
in interface Attributed
- Overrides:
getAttributionImage
in class AbstractTileSource
- Returns:
- The URL for the attribution image. Null if no image should be displayed.
getAttributionImageURL
public java.lang.String getAttributionImageURL()
- Specified by:
getAttributionImageURL
in interface Attributed
- Overrides:
getAttributionImageURL
in class AbstractTileSource
- Returns:
- The URL to open when the user clicks the attribution image.
When return value is null, the image is still displayed (provided getAttributionImage()
returns a value other than null), but the image does not link to a website.
getTermsOfUseText
public java.lang.String getTermsOfUseText()
- Specified by:
getTermsOfUseText
in interface Attributed
- Overrides:
getTermsOfUseText
in class AbstractTileSource
- Returns:
- The attribution "Terms of Use" text.
In case it returns null, but getTermsOfUseURL() is not null, a default
terms of use text is used.
getTermsOfUseURL
public java.lang.String getTermsOfUseURL()
- Specified by:
getTermsOfUseURL
in interface Attributed
- Overrides:
getTermsOfUseURL
in class AbstractTileSource
- Returns:
- The URL to open when the user clicks the attribution "Terms of Use" text.
JOSM