Skip to content

InMemoryRasterTileCache

Namespace: ThinkGeo.Core

In-memory raster tile cache with LRU eviction.

public class InMemoryRasterTileCache : RasterTileCache

Inheritance ObjectTileCacheRasterTileCacheInMemoryRasterTileCache

Properties

MaximumTilesCount

Gets or sets the maximum number of tiles to keep in memory. Set to 0 to disable caching (and it will clear existing cached tiles).

public int MaximumTilesCount { get; set; }

Property Value

Int32

NoDataTileImage

This property returns back a preset image showing the tileView data is missing.

public GeoImage NoDataTileImage { get; }

Property Value

GeoImage

LoadingTileImage

This property returns back a preset image showing the Tile is loading.

public GeoImage LoadingTileImage { get; }

Property Value

GeoImage

ImageFormat

Gets or sets the tileView image format.

public GeoImageFormat ImageFormat { get; set; }

Property Value

GeoImageFormat

JpegQuality

Gets or sets the Jpeg quality , this property only take effects when setting the ImageFormat to Jpeg.

public short JpegQuality { get; set; }

Property Value

Int16

TileAccessMode

Gets or sets the Mode for the TileCache access the tiles. The Default value is ReadAddDelete

public TileAccessMode TileAccessMode { get; set; }

Property Value

TileAccessMode

Remarks:

If you want it to take effect, you need set the Read property false.

CacheId

Gets or sets the id of the TileCache.

public string CacheId { get; set; }

Property Value

String

ExpirationTime

Gets or sets the ExpirationTime.

public TimeSpan ExpirationTime { get; set; }

Property Value

TimeSpan

Constructors

InMemoryRasterTileCache()

Default constructor.

public InMemoryRasterTileCache()

Remarks:

If you use this constructor, you can adjust MaximumTilesCount later.

InMemoryRasterTileCache(Int32, GeoImageFormat)

Optional convenience constructor.

public InMemoryRasterTileCache(int maximumTilesCount, GeoImageFormat imageFormat)

Parameters

maximumTilesCount Int32

imageFormat GeoImageFormat

Methods

GetTileCore(Int32, Int64, Int64)

Gets the cached tile for the given XYZ indices.

protected Tile GetTileCore(int zoom, long x, long y)

Parameters

zoom Int32
Zoom level.

x Int64
Tile X index.

y Int64
Tile Y index.

Returns

Tile
The cached tile if present; otherwise .

SaveTileCore(Tile)

Saves a tile into the in-memory cache.

protected void SaveTileCore(Tile tile)

Parameters

tile Tile
The tile to cache.

DeleteTileCore(Tile)

Removes a tile from the in-memory cache.

protected void DeleteTileCore(Tile tile)

Parameters

tile Tile
The tile to remove.

ClearCacheCore()

Clears all cached tiles from memory.

protected void ClearCacheCore()

Events

GottenCacheTile

Occurs when the GottenCacheTile event is raised.

public event EventHandler<GottenCacheImageBitmapTileCacheEventArgs> GottenCacheTile;

GettingCacheTile

Occurs when the GettingCacheTile event is raised.

public event EventHandler<GettingCacheImageBitmapTileCacheEventArgs> GettingCacheTile;

GottenTile

Occurs when the GottenTile event is raised.

public event EventHandler<GottenTileTileCacheEventArgs> GottenTile;

GettingTile

Occurs when the GettingTile event is raised.

public event EventHandler<GettingTileTileCacheEventArgs> GettingTile;

SavingTile

Occurs when the SavingTile event is raised.

public event EventHandler<SavingTileTileCacheEventArgs> SavingTile;

SavedTile

Occurs when the SavedTile event is raised.

public event EventHandler<SavedTileTileCacheEventArgs> SavedTile;