public abstract class TileService extends Object
TileServices must at least have a name and a base URL.
| Modifier | Constructor and Description | 
|---|---|
| protected  | TileService(String name,
           String baseURL)Create a new TileService with a name and a base URL | 
| Modifier and Type | Method and Description | 
|---|---|
| protected Tile | addTileToCache(Tile tile)Add a tile to the cache. | 
| static ReferencedEnvelope | createSafeEnvelopeInWGS84(ReferencedEnvelope _mapExtent) | 
| Set<Tile> | findTilesInExtent(ReferencedEnvelope _mapExtent,
                 int scaleFactor,
                 boolean recommendedZoomLevel,
                 int maxNumberOfTiles) | 
| String | getBaseUrl()Returns the prefix of an tile-url, e.g.: http://tile.openstreetmap.org/ | 
| abstract ReferencedEnvelope | getBounds() | 
| int | getMaxZoomLevel()Returns the highest zoom-level number from the scaleList. | 
| int | getMinZoomLevel()Returns the lowest zoom-level number from the scaleList. | 
| String | getName() | 
| abstract CoordinateReferenceSystem | getProjectedTileCrs()The projection the tiles are drawn in. | 
| abstract double[] | getScaleList()Returns a list that represents a mapping between zoom-levels and map scale. | 
| CoordinateReferenceSystem | getTileCrs()Deprecated. 
 is it really meaningful? | 
| abstract TileFactory | getTileFactory()Returns the TileFactory which is used to call the method getTileFromCoordinate(). | 
| int | getTileHeight() | 
| int | getTileWidth() | 
| int | getZoomLevelFromMapScale(ScaleZoomLevelMatcher zoomLevelMatcher,
                        int scaleFactor)Translates the map scale into a zoom-level for the map services. | 
| int | getZoomLevelToUse(ScaleZoomLevelMatcher zoomLevelMatcher,
                 int scaleFactor,
                 boolean useRecommended)Returns the zoom-level that should be used to fetch the tiles. | 
| String | toString() | 
protected static final Logger LOGGER
protected TileService(String name, String baseURL)
name - the name. Cannot be null.baseURL - the base URL. This is a string representing the common part of the URL for all
     this service's tiles. Cannot be null. Note that this constructor doesn't ensure that the
     URL is well-formed.public String getName()
public int getTileWidth()
public int getTileHeight()
public String getBaseUrl()
@Deprecated public CoordinateReferenceSystem getTileCrs()
public int getZoomLevelFromMapScale(ScaleZoomLevelMatcher zoomLevelMatcher, int scaleFactor)
The scale-factor (0-100) decides whether the tiles will be scaled down (100) or scaled up (0).
scaleFactor - Scale-factor (0-100)public int getZoomLevelToUse(ScaleZoomLevelMatcher zoomLevelMatcher, int scaleFactor, boolean useRecommended)
scale - scaleFactor - useRecommended - always use the calculated zoom-level, do not use the one the user
     selectedpublic int getMinZoomLevel()
scaleList - public int getMaxZoomLevel()
scaleList - public Set<Tile> findTilesInExtent(ReferencedEnvelope _mapExtent, int scaleFactor, boolean recommendedZoomLevel, int maxNumberOfTiles)
protected Tile addTileToCache(Tile tile)
The cache used here is a soft cache, which has an un-controllable time to live (could last a split seconds or 100 years).
Subclasses services (such as WMTS) may have some more hints about the tile TTL, so a more controllable cache should be implemented in these cases.
public abstract double[] getScaleList()
Array index: zoom-level Value at index: map scale High zoom-level -> more detailed map Low zoom-level -> less detailed map
public abstract ReferencedEnvelope getBounds()
public abstract CoordinateReferenceSystem getProjectedTileCrs()
public abstract TileFactory getTileFactory()
public static final ReferencedEnvelope createSafeEnvelopeInWGS84(ReferencedEnvelope _mapExtent)
Copyright © 1996–2019 Geotools. All rights reserved.