
public class CacheManager extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
CacheManager.CacheManagerAction
Action to perform on a tile within a CacheManagerTask
|
static interface |
CacheManager.CacheManagerCallback |
static class |
CacheManager.CacheManagerDialog |
static class |
CacheManager.CacheManagerTask
generic class for common code related to AsyncTask management
- performing an action
- within a manager
- on a list of tiles (potentially sorted by ascending zoom level)
- and with callbacks for task progression
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
mMaxZoomLevel |
protected int |
mMinZoomLevel |
protected Set<CacheManager.CacheManagerTask> |
mPendingTasks |
protected MapTileProviderBase |
mTileProvider |
protected IFilesystemCache |
mTileWriter |
| Constructor and Description |
|---|
CacheManager(MapTileProviderBase pTileProvider,
IFilesystemCache pWriter,
int pMinZoomLevel,
int pMaxZoomLevel)
See https://github.com/osmdroid/osmdroid/issues/619
|
CacheManager(MapView mapView) |
CacheManager(MapView mapView,
IFilesystemCache writer) |
| Modifier and Type | Method and Description |
|---|---|
long |
cacheCapacity() |
void |
cancelAllJobs()
cancels all tasks
|
boolean |
checkTile(MapTile pTile) |
CacheManager.CacheManagerTask |
cleanAreaAsync(Context ctx,
ArrayList<GeoPoint> geoPoints,
int zoomMin,
int zoomMax)
Remove all cached tiles covered by the GeoPoints list.
|
CacheManager.CacheManagerTask |
cleanAreaAsync(Context ctx,
BoundingBox bb,
int zoomMin,
int zoomMax)
Remove all cached tiles in the specified area.
|
CacheManager.CacheManagerTask |
cleanAreaAsync(Context ctx,
List<MapTile> tiles,
int zoomMin,
int zoomMax)
Remove all cached tiles in the specified area.
|
long |
currentCacheUsage() |
boolean |
deleteTile(MapTile pTile) |
long |
directorySize(File pDirectory) |
CacheManager.CacheManagerTask |
downloadAreaAsync(Context ctx,
ArrayList<GeoPoint> geoPoints,
int zoomMin,
int zoomMax)
Download in background all tiles of the specified area in osmdroid cache.
|
CacheManager.CacheManagerTask |
downloadAreaAsync(Context ctx,
ArrayList<GeoPoint> geoPoints,
int zoomMin,
int zoomMax,
CacheManager.CacheManagerCallback callback)
Download in background all tiles covered by the GePoints list in osmdroid cache.
|
CacheManager.CacheManagerTask |
downloadAreaAsync(Context ctx,
BoundingBox bb,
int zoomMin,
int zoomMax)
Download in background all tiles of the specified area in osmdroid cache.
|
CacheManager.CacheManagerTask |
downloadAreaAsync(Context ctx,
BoundingBox bb,
int zoomMin,
int zoomMax,
CacheManager.CacheManagerCallback callback)
Download in background all tiles of the specified area in osmdroid cache.
|
CacheManager.CacheManagerTask |
downloadAreaAsync(Context ctx,
List<MapTile> pTiles,
int zoomMin,
int zoomMax)
Download in background all tiles of the specified area in osmdroid cache.
|
CacheManager.CacheManagerTask |
downloadAreaAsyncNoUI(Context ctx,
ArrayList<GeoPoint> geoPoints,
int zoomMin,
int zoomMax,
CacheManager.CacheManagerCallback callback)
Download in background all tiles covered by the GeoPoints list in osmdroid cache without a user interface.
|
CacheManager.CacheManagerTask |
downloadAreaAsyncNoUI(Context ctx,
BoundingBox bb,
int zoomMin,
int zoomMax,
CacheManager.CacheManagerCallback callback)
Download in background all tiles of the specified area in osmdroid cache without a user interface.
|
CacheManager.CacheManagerTask |
execute(CacheManager.CacheManagerTask pTask) |
BoundingBox |
extendedBoundsFromGeoPoints(ArrayList<GeoPoint> geoPoints,
int minZoomLevel) |
CacheManager.CacheManagerAction |
getCleaningAction() |
CacheManager.CacheManagerDialog |
getCleaningDialog(Context pCtx,
CacheManager.CacheManagerTask pTask) |
static GeoPoint |
getCoordinatesFromMapTile(int x,
int y,
int zoom) |
CacheManager.CacheManagerAction |
getDownloadingAction() |
CacheManager.CacheManagerDialog |
getDownloadingDialog(Context pCtx,
CacheManager.CacheManagerTask pTask) |
static File |
getFileName(ITileSource tileSource,
MapTile tile) |
static Point |
getMapTileFromCoordinates(double aLat,
double aLon,
int zoom) |
int |
getPendingJobs() |
static Collection<MapTile> |
getTilesCoverage(ArrayList<GeoPoint> pGeoPoints,
int pZoomLevel)
Computes the theoretical tiles covered by the list of points
Calculation done based on http://www.movable-type.co.uk/scripts/latlong.html
|
static List<MapTile> |
getTilesCoverage(ArrayList<GeoPoint> pGeoPoints,
int pZoomMin,
int pZoomMax)
Computes the theoretical tiles covered by the list of points
|
static Collection<MapTile> |
getTilesCoverage(BoundingBox pBB,
int pZoomLevel)
Computes the theoretical tiles covered by the bounding box
|
static List<MapTile> |
getTilesCoverage(BoundingBox pBB,
int pZoomMin,
int pZoomMax)
Computes the theoretical tiles covered by the bounding box
|
boolean |
loadTile(OnlineTileSourceBase tileSource,
MapTile tile) |
int |
possibleTilesCovered(ArrayList<GeoPoint> pGeoPoints,
int pZoomMin,
int pZoomMax) |
int |
possibleTilesInArea(BoundingBox pBB,
int pZoomMin,
int pZoomMax) |
protected final MapTileProviderBase mTileProvider
protected final IFilesystemCache mTileWriter
protected final int mMinZoomLevel
protected final int mMaxZoomLevel
protected Set<CacheManager.CacheManagerTask> mPendingTasks
public CacheManager(MapView mapView)
public CacheManager(MapView mapView, IFilesystemCache writer)
public CacheManager(MapTileProviderBase pTileProvider, IFilesystemCache pWriter, int pMinZoomLevel, int pMaxZoomLevel)
public int getPendingJobs()
public static Point getMapTileFromCoordinates(double aLat,
double aLon,
int zoom)
public static GeoPoint getCoordinatesFromMapTile(int x, int y, int zoom)
public static File getFileName(ITileSource tileSource, MapTile tile)
public boolean loadTile(OnlineTileSourceBase tileSource, MapTile tile)
public boolean deleteTile(MapTile pTile)
public boolean checkTile(MapTile pTile)
public static List<MapTile> getTilesCoverage(BoundingBox pBB, int pZoomMin, int pZoomMax)
public static Collection<MapTile> getTilesCoverage(BoundingBox pBB, int pZoomLevel)
public static List<MapTile> getTilesCoverage(ArrayList<GeoPoint> pGeoPoints, int pZoomMin, int pZoomMax)
public static Collection<MapTile> getTilesCoverage(ArrayList<GeoPoint> pGeoPoints, int pZoomLevel)
public int possibleTilesInArea(BoundingBox pBB, int pZoomMin, int pZoomMax)
public int possibleTilesCovered(ArrayList<GeoPoint> pGeoPoints, int pZoomMin, int pZoomMax)
public CacheManager.CacheManagerTask execute(CacheManager.CacheManagerTask pTask)
public CacheManager.CacheManagerTask downloadAreaAsync(Context ctx, BoundingBox bb, int zoomMin, int zoomMax)
ctx - bb - zoomMin - zoomMax - public CacheManager.CacheManagerTask downloadAreaAsync(Context ctx, ArrayList<GeoPoint> geoPoints, int zoomMin, int zoomMax)
ctx - geoPoints - zoomMin - zoomMax - public CacheManager.CacheManagerTask downloadAreaAsync(Context ctx, BoundingBox bb, int zoomMin, int zoomMax, CacheManager.CacheManagerCallback callback)
ctx - bb - zoomMin - zoomMax - public CacheManager.CacheManagerTask downloadAreaAsync(Context ctx, ArrayList<GeoPoint> geoPoints, int zoomMin, int zoomMax, CacheManager.CacheManagerCallback callback)
ctx - geoPoints - zoomMin - zoomMax - public CacheManager.CacheManagerTask downloadAreaAsyncNoUI(Context ctx, ArrayList<GeoPoint> geoPoints, int zoomMin, int zoomMax, CacheManager.CacheManagerCallback callback)
ctx - geoPoints - zoomMin - zoomMax - public CacheManager.CacheManagerTask downloadAreaAsyncNoUI(Context ctx, BoundingBox bb, int zoomMin, int zoomMax, CacheManager.CacheManagerCallback callback)
ctx - bb - zoomMin - zoomMax - public void cancelAllJobs()
public CacheManager.CacheManagerTask downloadAreaAsync(Context ctx, List<MapTile> pTiles, int zoomMin, int zoomMax)
ctx - pTiles - zoomMin - zoomMax - public CacheManager.CacheManagerDialog getDownloadingDialog(Context pCtx, CacheManager.CacheManagerTask pTask)
public CacheManager.CacheManagerDialog getCleaningDialog(Context pCtx, CacheManager.CacheManagerTask pTask)
public CacheManager.CacheManagerAction getDownloadingAction()
public CacheManager.CacheManagerAction getCleaningAction()
public CacheManager.CacheManagerTask cleanAreaAsync(Context ctx, BoundingBox bb, int zoomMin, int zoomMax)
ctx - bb - zoomMin - zoomMax - public CacheManager.CacheManagerTask cleanAreaAsync(Context ctx, ArrayList<GeoPoint> geoPoints, int zoomMin, int zoomMax)
ctx - geoPoints - zoomMin - zoomMax - public CacheManager.CacheManagerTask cleanAreaAsync(Context ctx, List<MapTile> tiles, int zoomMin, int zoomMax)
public BoundingBox extendedBoundsFromGeoPoints(ArrayList<GeoPoint> geoPoints, int minZoomLevel)
public long currentCacheUsage()
public long cacheCapacity()
public long directorySize(File pDirectory)