Package com.massifmaps.datasources
Class CombinedTileDataSource
java.lang.Object
com.massifmaps.datasources.TileDataSource
com.massifmaps.datasources.CombinedTileDataSource
A tile data source that combines two data sources (usually offline and online) and selects tiles
based on zoom level. All requests below specified zoom level are directed to the first data source
and all requests at or above specified zoom level are directed to the second data source.
based on zoom level. All requests below specified zoom level are directed to the first data source
and all requests at or above specified zoom level are directed to the second data source.
-
Constructor Summary
ConstructorsConstructorDescriptionCombinedTileDataSource(TileDataSource dataSource1, TileDataSource dataSource2, int zoomLevel) Constructs a combined tile data source object. -
Method Summary
Modifier and TypeMethodDescriptionReads one entry of the source's own metadata, when it has any - the MBTiles or PMTiles
metadata table, for instance.Returns the extent of the tiles in this data source.
The bounds are in coordinate system of the projection of the data source.intReturns the maximum zoom level supported by this data source.intReturns the minimum zoom level supported by this data source.Loads the specified tile.
Note: the tile coordinate system used here is vertically flipped relative to layer tile coordinate system.Methods inherited from class com.massifmaps.datasources.TileDataSource
buildTagValues, containsMetaDataKey, getMaxOverzoomLevel, getMaxZoomWithOverzoom, getMetaData, getMetaDataElement, getProjection, isMaxOverzoomLevelSet, notifyTilesChanged, setMaxOverzoomLevel, setMetaData, setMetaDataElement
-
Constructor Details
-
CombinedTileDataSource
public CombinedTileDataSource(TileDataSource dataSource1, TileDataSource dataSource2, int zoomLevel) Constructs a combined tile data source object.- Parameters:
dataSource1- First data source that is used if requested tile is below given zoomLevel.dataSource2- Second data source that is used if requested tile is at or above given zoomLevel.zoomLevel- Threshold zoom level value.
-
-
Method Details
-
getMinZoom
public int getMinZoom()Description copied from class:TileDataSourceReturns the minimum zoom level supported by this data source.- Overrides:
getMinZoomin classTileDataSource- Returns:
- The minimum zoom level supported (inclusive).
-
getMaxZoom
public int getMaxZoom()Description copied from class:TileDataSourceReturns the maximum zoom level supported by this data source.- Overrides:
getMaxZoomin classTileDataSource- Returns:
- The maximum zoom level supported (exclusive).
-
getDataExtent
Description copied from class:TileDataSourceReturns the extent of the tiles in this data source.
The bounds are in coordinate system of the projection of the data source.- Overrides:
getDataExtentin classTileDataSource- Returns:
- The extent of the data source.
-
getContainerMetaData
Description copied from class:TileDataSourceReads one entry of the source's own metadata, when it has any - the MBTiles or PMTiles
metadata table, for instance. Sources that carry none return an empty string, as do keys
they do not define. Unlike the meta data map above this is read-only and is NOT attached
to the loaded tiles: a container's metadata can be tens of kilobytes.- Overrides:
getContainerMetaDatain classTileDataSource- Parameters:
key- The metadata key, as named by the container's specification.- Returns:
- The value, or empty string if the source does not provide it.
-
loadTile
Description copied from class:TileDataSourceLoads the specified tile.
Note: the tile coordinate system used here is vertically flipped relative to layer tile coordinate system.- Overrides:
loadTilein classTileDataSource- Parameters:
tile- The tile to load.- Returns:
- The tile data. If the tile is not available, null may be returned.
-