org.openstreetmap.gui.jmapviewer.tilesources
Class BingAerialTileSource

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.BingAerialTileSource
All Implemented Interfaces:
Attributed, TileSource
Direct Known Subclasses:
TMSLayer.CachedAttributionBingAerialTileSource

public class BingAerialTileSource
extends AbstractTMSTileSource


Nested Class Summary
protected  class BingAerialTileSource.Attribution
           
 
Nested classes/interfaces inherited from interface org.openstreetmap.gui.jmapviewer.interfaces.TileSource
TileSource.TileUpdate
 
Field Summary
private static java.lang.String API_KEY
           
private static java.util.concurrent.Future<java.util.List<BingAerialTileSource.Attribution>> attributions
           
private static java.util.regex.Pattern culturePattern
           
private static java.lang.Integer imageryZoomMax
           
private static java.lang.String imageUrlTemplate
           
private static java.util.regex.Pattern quadkeyPattern
           
private static java.util.regex.Pattern subdomainPattern
           
private static java.lang.String[] subdomains
           
 
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
BingAerialTileSource()
           
 
Method Summary
(package private) static java.lang.String computeQuadTree(int zoom, int tilex, int tiley)
           
protected  java.util.List<BingAerialTileSource.Attribution> getAttribution()
           
 java.awt.Image getAttributionImage()
           
 java.lang.String getAttributionImageURL()
           
 java.lang.String getAttributionLinkURL()
           
protected  java.util.concurrent.Callable<java.util.List<BingAerialTileSource.Attribution>> getAttributionLoaderCallable()
           
 java.lang.String getAttributionText(int zoom, Coordinate topLeft, Coordinate botRight)
           
protected  java.net.URL getAttributionUrl()
           
 int getMaxZoom()
          Specifies the maximum zoom value.
 java.lang.String getTermsOfUseText()
           
 java.lang.String getTermsOfUseURL()
           
 TileSource.TileUpdate getTileUpdate()
           
 java.lang.String getTileUrl(int zoom, int tilex, int tiley)
          Constructs the tile url.
protected  java.util.List<BingAerialTileSource.Attribution> parseAttributionText(org.xml.sax.InputSource xml)
           
 boolean requiresAttribution()
           
 
Methods inherited from class org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource
getBaseUrl, getExtension, getMinZoom, getName, getTilePath, getTileSize, getTileType, latToTileY, lonToTileX, tileXToLon, tileYToLat, toString
 
Methods inherited from class org.openstreetmap.gui.jmapviewer.tilesources.AbstractTileSource
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

API_KEY

private static java.lang.String API_KEY

attributions

private static volatile java.util.concurrent.Future<java.util.List<BingAerialTileSource.Attribution>> attributions

imageUrlTemplate

private static java.lang.String imageUrlTemplate

imageryZoomMax

private static java.lang.Integer imageryZoomMax

subdomains

private static java.lang.String[] subdomains

subdomainPattern

private static final java.util.regex.Pattern subdomainPattern

quadkeyPattern

private static final java.util.regex.Pattern quadkeyPattern

culturePattern

private static final java.util.regex.Pattern culturePattern
Constructor Detail

BingAerialTileSource

public BingAerialTileSource()
Method Detail

getTileUrl

public java.lang.String getTileUrl(int zoom,
                                   int tilex,
                                   int tiley)
                            throws java.io.IOException
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
Throws:
java.io.IOException

getAttributionUrl

protected java.net.URL getAttributionUrl()
                                  throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

parseAttributionText

protected java.util.List<BingAerialTileSource.Attribution> parseAttributionText(org.xml.sax.InputSource xml)
                                                                         throws java.io.IOException
Throws:
java.io.IOException

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

getTileUpdate

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

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.

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.

getAttributionLoaderCallable

protected java.util.concurrent.Callable<java.util.List<BingAerialTileSource.Attribution>> getAttributionLoaderCallable()

getAttribution

protected java.util.List<BingAerialTileSource.Attribution> getAttribution()

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.

computeQuadTree

static java.lang.String computeQuadTree(int zoom,
                                        int tilex,
                                        int tiley)


JOSM