Class AwtUtil

java.lang.Object
org.mapsforge.map.awt.util.AwtUtil

public final class AwtUtil extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.mapsforge.map.layer.cache.TileCache
    createTileCache(int tileSize, double overdrawFactor, int capacity, File cacheDirectory)
    Utility function to create a two-level tile cache with the right size, using the size of the screen.
    static int
    getMinimumCacheSize(int tileSize, double overdrawFactor)
    Compute the minimum cache size for a view, using the size of the screen.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • createTileCache

      public static org.mapsforge.map.layer.cache.TileCache createTileCache(int tileSize, double overdrawFactor, int capacity, File cacheDirectory)
      Utility function to create a two-level tile cache with the right size, using the size of the screen.

      Combine with FrameBufferController.setUseSquareFrameBuffer(false);

      Parameters:
      tileSize - the tile size
      overdrawFactor - the overdraw factor applied to the map view
      capacity - the maximum number of entries in file cache
      cacheDirectory - the directory where cached tiles will be stored
      Returns:
      a new cache created on the file system
    • getMinimumCacheSize

      public static int getMinimumCacheSize(int tileSize, double overdrawFactor)
      Compute the minimum cache size for a view, using the size of the screen.

      Combine with FrameBufferController.setUseSquareFrameBuffer(false);

      Parameters:
      tileSize - the tile size
      overdrawFactor - the overdraw factor applied to the map view
      Returns:
      the minimum cache size for the view