Package org.mapsforge.map.awt.util
Class AwtUtil
java.lang.Object
org.mapsforge.map.awt.util.AwtUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.mapsforge.map.layer.cache.TileCachecreateTileCache(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 intgetMinimumCacheSize(int tileSize, double overdrawFactor) Compute the minimum cache size for a view, using the size of the screen.
-
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 sizeoverdrawFactor- the overdraw factor applied to the map viewcapacity- the maximum number of entries in file cachecacheDirectory- 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 sizeoverdrawFactor- the overdraw factor applied to the map view- Returns:
- the minimum cache size for the view
-