Skip to content

TileCache

Namespace: ThinkGeo.Core

This is the base class for TileCache system.

public abstract class TileCache

Inheritance ObjectTileCache

Remarks:

TileCahce system is very efficient in improving the performance of application, especially when large data or remote server images are included.

Properties

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

Methods

OnGottenCacheTile(GottenCacheImageBitmapTileCacheEventArgs)

protected void OnGottenCacheTile(GottenCacheImageBitmapTileCacheEventArgs e)

Parameters

e GottenCacheImageBitmapTileCacheEventArgs

OnGettingCacheTile(GettingCacheImageBitmapTileCacheEventArgs)

protected void OnGettingCacheTile(GettingCacheImageBitmapTileCacheEventArgs e)

Parameters

e GettingCacheImageBitmapTileCacheEventArgs

GetTile(Int32, Int64, Int64)

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

public Tile GetTile(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.

SaveTile(Tile)

This method will save the target tileView passed in.

public void SaveTile(Tile tile)

Parameters

tile Tile
The target tileView to be saved.

Exceptions

ArgumentNullException
If you pass a null as the target tileView, we will throw an ArgumentNullException.

Remarks:

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

DeleteTile(Tile)

This method will delete the target tileView passed in.

public void DeleteTile(Tile tile)

Parameters

tile Tile
The target tileView to be deleted.

Exceptions

ArgumentNullException
If you pass a null as the target tileView, we will throw an ArgumentNullException.

Remarks:

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

ClearCache()

This method will clear all the tiles in the tileCache.

public void ClearCache()

Remarks:

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

ClearCacheCore()

This abstract method will clear all the tiles in the tileCache, for each sub TileCache class must implement this method.

protected abstract void ClearCacheCore()

Remarks:

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

SaveTileCore(Tile)

This abstract method will save the target tileView passed in, for each sub TileCache class must implement this method.

protected abstract 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 abstract method will delete the target tileView passed in, for each sub TileCache class must implement this method.

protected abstract 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.

GetTileCore(Int32, Int64, Int64)

This abstract method returns the BitmapTile corresponding to passed in row and column. Each concrete TileCache need to implement this logic to get tileView from a row and column.

protected abstract 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.

Events

GottenCacheTile

public event EventHandler<GottenCacheImageBitmapTileCacheEventArgs> GottenCacheTile;

GettingCacheTile

public event EventHandler<GettingCacheImageBitmapTileCacheEventArgs> GettingCacheTile;