-
public class MapTileApproximater extends MapTileModuleProviderBase
The MapTileApproximater computes approximation of tiles. The approximation is based on the tiles of the same region, but on lower zoom level tiles. An obvious use is in offline mode: it's better to display an approximation than an empty grey square.
-
-
Constructor Summary
Constructors Constructor Description MapTileApproximater()MapTileApproximater(int pThreadPoolSize, int pPendingQueueSize)
-
Method Summary
Modifier and Type Method Description voidaddProvider(MapTileModuleProviderBase pProvider)booleangetUsesDataConnection()Returns true if implementation uses a data connection, false otherwise. MapTileApproximater.TileLoadergetTileLoader()It is expected that the implementation will construct an internal member which internallyimplements a TileLoader. intgetMinimumZoomLevel()Gets the minimum zoom level this tile provider can provide intgetMaximumZoomLevel()Gets the maximum zoom level this tile provider can provide voidsetTileSource(ITileSource pTileSource)Sets the tile source for this tile provider. BitmapapproximateTileFromLowerZoom(long pMapTileIndex)Approximate a tile from a lower zoom level BitmapapproximateTileFromLowerZoom(long pMapTileIndex, int pZoomDiff)Approximate a tile from a lower zoom level static BitmapapproximateTileFromLowerZoom(MapTileModuleProviderBase pProvider, long pMapTileIndex, int pZoomDiff)Approximate a tile from a lower zoom level static BitmapapproximateTileFromLowerZoom(BitmapDrawable pSrcDrawable, long pMapTileIndex, int pZoomDiff)Approximate a tile from a lower zoom level static BitmapgetTileBitmap(int pTileSizePx)Try to get a tile bitmap from the pool, otherwise allocate a new one voiddetach()-
-
Method Detail
-
addProvider
void addProvider(MapTileModuleProviderBase pProvider)
-
getUsesDataConnection
boolean getUsesDataConnection()
Returns true if implementation uses a data connection, false otherwise. This value is used todetermine if this provider should be skipped if there is no data connection.
-
getTileLoader
MapTileApproximater.TileLoader getTileLoader()
It is expected that the implementation will construct an internal member which internallyimplements a TileLoader. This method is expected to return a that internal member tomethods of the parent methods.
-
getMinimumZoomLevel
int getMinimumZoomLevel()
Gets the minimum zoom level this tile provider can provide
-
getMaximumZoomLevel
int getMaximumZoomLevel()
Gets the maximum zoom level this tile provider can provide
-
setTileSource
@Deprecated() void setTileSource(ITileSource pTileSource)
Sets the tile source for this tile provider.
-
approximateTileFromLowerZoom
Bitmap approximateTileFromLowerZoom(long pMapTileIndex)
Approximate a tile from a lower zoom level
- Parameters:
pMapTileIndex- Destination tile, for the same place on the planet as the source, but on a higher zoom
-
approximateTileFromLowerZoom
Bitmap approximateTileFromLowerZoom(long pMapTileIndex, int pZoomDiff)
Approximate a tile from a lower zoom level
- Parameters:
pMapTileIndex- Destination tile, for the same place on the planet as the source, but on a higher zoompZoomDiff- Zoom level difference between the destination and the source; strictly positive
-
approximateTileFromLowerZoom
static Bitmap approximateTileFromLowerZoom(MapTileModuleProviderBase pProvider, long pMapTileIndex, int pZoomDiff)
Approximate a tile from a lower zoom level
- Parameters:
pProvider- Source tile providerpMapTileIndex- Destination tile, for the same place on the planet as the source, but on a higher zoompZoomDiff- Zoom level difference between the destination and the source; strictly positive
-
approximateTileFromLowerZoom
static Bitmap approximateTileFromLowerZoom(BitmapDrawable pSrcDrawable, long pMapTileIndex, int pZoomDiff)
Approximate a tile from a lower zoom level
- Parameters:
pSrcDrawable- Source tile bitmappMapTileIndex- Destination tile, for the same place on the planet as the source, but on a higher zoompZoomDiff- Zoom level difference between the destination and the source; strictly positive
-
getTileBitmap
static Bitmap getTileBitmap(int pTileSizePx)
Try to get a tile bitmap from the pool, otherwise allocate a new one
-
detach
void detach()
-
-
-
-