Skip to content

InMemoryRasterTileCache

Namespace: ThinkGeo.Core

This class is a concrete class inherits from BitmapTileCache. In this class, the tiles will be saved in memory and it provides some properties to control it very easily.

public class InMemoryRasterTileCache : RasterTileCache

Inheritance ObjectTileCacheRasterTileCacheInMemoryRasterTileCache

Properties

MaximumTilesCount

This property gets or sets the maximum tiles count, if it exceed,it will delete the old first 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 RasterTileFormat ImageFormat { get; set; }

Property Value

RasterTileFormat

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

public TimeSpan ExpirationTime { get; set; }

Property Value

TimeSpan

Constructors

InMemoryRasterTileCache()

This is the default constructor.

public InMemoryRasterTileCache()

Remarks:

If you use this constructor, you have to set the properties manually.

Methods

GetTileCore(Int32, Int64, Int64)

This method returns the BitmapTile corresponding to passed in row and column.

protected Tile GetTileCore(int zoom, long column, long row)

Parameters

zoom Int32

column Int64
The target column for the tileView to fetch.

row Int64
The target row for the tileView to fetch.

Returns

Tile
Returns the BitmapTile corresponding to the passed in row and column.

SaveTileCore(Tile)

This method will save the target tileView passed in.

protected void SaveTileCore(Tile tile)

Parameters

tile Tile
The target tileView to be saved.

Remarks:

This method will not take effect when the Read is set to true.

DeleteTileCore(Tile)

This method will delete the target tileView passed in.

protected void DeleteTileCore(Tile tile)

Parameters

tile Tile
The target tileView to be deleted.

Remarks:

This method will not take effect when the Read is set to true.

ClearCacheCore()

This method will clear all the tiles in the tileCache.

protected void ClearCacheCore()

Remarks:

This method will not take effect when the Read is set to true.

Events

GottenCacheTile

public event EventHandler<GottenCacheImageBitmapTileCacheEventArgs> GottenCacheTile;

GettingCacheTile

public event EventHandler<GettingCacheImageBitmapTileCacheEventArgs> GettingCacheTile;