public class

CacheTileDataSource

extends TileDataSource
java.lang.Object
   ↳ com.carto.datasources.TileDataSource
     ↳ com.carto.datasources.CacheTileDataSource
Known Direct Subclasses

Class Overview

A tile data source that loads tiles from another tile data source and caches them.

Summary

Public Methods
void clear()
Clear the cache.
synchronized void delete()
long getCapacity()
Returns the tile cache capacity.
MapBounds getDataExtent()
Returns the extent of the tiles in this data source.
TileDataSource getDataSource()
Returns the original data source that the cache uses.
int getMaxZoom()
Returns the maximum zoom level supported by this data source.
int getMinZoom()
Returns the minimum zoom level supported by this data source.
void notifyTilesChanged(boolean removeTiles)
Notifies listeners that the tiles have changed.
void setCapacity(long capacityInBytes)
Sets the cache capacity.
[Expand]
Inherited Methods
From class com.carto.datasources.TileDataSource
From class java.lang.Object

Public Methods

public void clear ()

Clear the cache.

public synchronized void delete ()

public long getCapacity ()

Returns the tile cache capacity.

Returns
  • The tile cache capacity in bytes.

public MapBounds getDataExtent ()

Returns the extent of the tiles in this data source.
The bounds are in coordinate system of the projection of the data source.

Returns
  • The extent of the data source.

public TileDataSource getDataSource ()

Returns the original data source that the cache uses.

Returns
  • The original data source.

public int getMaxZoom ()

Returns the maximum zoom level supported by this data source.

Returns
  • The maximum zoom level supported (exclusive).

public int getMinZoom ()

Returns the minimum zoom level supported by this data source.

Returns
  • The minimum zoom level supported (inclusive).

public void notifyTilesChanged (boolean removeTiles)

Notifies listeners that the tiles have changed. Action taken depends on the implementation of the
listeners, but generally all cached tiles will be reloaded. If the removeTiles flag is set all caches will be cleared
prior to reloading, if it's not set then the reloaded tiles will replace the old tiles in caches as they finish loading.

Parameters
removeTiles The remove tiles flag.

public void setCapacity (long capacityInBytes)

Sets the cache capacity.

Parameters
capacityInBytes The new tile cache capacity in bytes.