java.lang.Object | |||
↳ | com.carto.datasources.TileDataSource | ||
↳ | com.carto.datasources.CacheTileDataSource | ||
↳ | com.carto.datasources.MemoryCacheTileDataSource |
A tile data source that loads tiles from another tile data source
and caches them in memory. This cache is not persistent, tiles
will be cleared once the application closes. Default cache capacity is 6MB.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
MemoryCacheTileDataSource(TileDataSource dataSource)
Constructs a MemoryCacheTileDataSource object from tile data source.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
clear()
Clear the cache.
| ||||||||||
synchronized void | delete() | ||||||||||
long |
getCapacity()
Returns the tile cache capacity.
| ||||||||||
TileData |
loadTile(MapTile mapTile)
Loads the specified tile.
| ||||||||||
void |
setCapacity(long capacityInBytes)
Sets the cache capacity.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Constructs a MemoryCacheTileDataSource object from tile data source.
dataSource | The datasource to be cached. |
---|
Clear the cache.
Returns the tile cache capacity.
Loads the specified tile.
Note: the tile coordinate system used here is vertically flipped relative to layer tile coordinate system.
mapTile | The tile to load. |
---|
Sets the cache capacity.
capacityInBytes | The new tile cache capacity in bytes. |
---|