Package 

Class MapTileApproximater


  • 
    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 Detail

      • MapTileApproximater

        MapTileApproximater()
      • MapTileApproximater

        MapTileApproximater(int pThreadPoolSize, int pPendingQueueSize)
    • Method Detail

      • 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

      • 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 zoom
        pZoomDiff - 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 provider
        pMapTileIndex - Destination tile, for the same place on the planet as the source, but on a higher zoom
        pZoomDiff - 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 bitmap
        pMapTileIndex - Destination tile, for the same place on the planet as the source, but on a higher zoom
        pZoomDiff - 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