TileCache¶
Namespace: ThinkGeo.Core
This is the base class for TileCache system.
public abstract class TileCache
Inheritance Object → TileCache
Remarks:
TileCache 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¶
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¶
ExpirationTime¶
public TimeSpan ExpirationTime { get; set; }
Property Value¶
Methods¶
OnGottenCacheTile(GottenCacheImageBitmapTileCacheEventArgs)¶
protected void OnGottenCacheTile(GottenCacheImageBitmapTileCacheEventArgs e)
Parameters¶
e
GottenCacheImageBitmapTileCacheEventArgs
OnGottenTile(GottenTileTileCacheEventArgs)¶
protected void OnGottenTile(GottenTileTileCacheEventArgs e)
Parameters¶
e
GottenTileTileCacheEventArgs
OnGettingCacheTile(GettingCacheImageBitmapTileCacheEventArgs)¶
protected void OnGettingCacheTile(GettingCacheImageBitmapTileCacheEventArgs e)
Parameters¶
e
GettingCacheImageBitmapTileCacheEventArgs
OnGettingTile(GettingTileTileCacheEventArgs)¶
protected void OnGettingTile(GettingTileTileCacheEventArgs e)
Parameters¶
e
GettingTileTileCacheEventArgs
GetTile(Int32, Int64, Int64)¶
This method returns the BitmapTile corresponding to passed in row and column.
public Tile GetTile(int zoom, long x, long y)
Parameters¶
zoom
Int32
x
Int64
The target column for the tileView to fetch.
y
Int64
The target row for the tileView to fetch.
Returns¶
Tile
Returns the BitmapTile corresponding to the passed in row and column.
GetTileAsync(Int32, Int64, Int64, CancellationToken)¶
This method returns the BitmapTile corresponding to passed in row and column.
public Task<Tile> GetTileAsync(int zoom, long x, long y, CancellationToken cancellationToken)
Parameters¶
zoom
Int32
x
Int64
y
Int64
cancellationToken
CancellationToken
Returns¶
Task<Tile>
Returns the BitmapTile corresponding to the passed in row and column.
OnSavingTile(SavingTileTileCacheEventArgs)¶
protected void OnSavingTile(SavingTileTileCacheEventArgs e)
Parameters¶
e
SavingTileTileCacheEventArgs
OnSavedTile(SavedTileTileCacheEventArgs)¶
protected void OnSavedTile(SavedTileTileCacheEventArgs e)
Parameters¶
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.
SaveTileAsync(Tile, CancellationToken)¶
public Task SaveTileAsync(Tile tile, CancellationToken cancellationToken)
Parameters¶
tile
Tile
cancellationToken
CancellationToken
Returns¶
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.
ClearCache()¶
This method will clear all the tiles in the tileCache.
public void ClearCache()
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()
SaveTileCore(Tile)¶
This abstract method will save the target tileView passed in, for each sub TileCache class must implement this method.
protected void SaveTileCore(Tile tile)
Parameters¶
tile
Tile
The target tileView to be saved.
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.
SaveTileAsyncCore(Tile, CancellationToken)¶
protected Task SaveTileAsyncCore(Tile tile, CancellationToken cancellationToken)
Parameters¶
tile
Tile
cancellationToken
CancellationToken
Returns¶
GetTileAsyncCore(Int32, Int64, Int64, CancellationToken)¶
protected Task<Tile> GetTileAsyncCore(int zoom, long x, long y, CancellationToken cancellationToken)
Parameters¶
zoom
Int32
x
Int64
y
Int64
cancellationToken
CancellationToken
Returns¶
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 Tile GetTileCore(int zoom, long x, long y)
Parameters¶
zoom
Int32
x
Int64
The target column for the tileView to fetch.
y
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;
GottenTile¶
public event EventHandler<GottenTileTileCacheEventArgs> GottenTile;
GettingTile¶
public event EventHandler<GettingTileTileCacheEventArgs> GettingTile;
SavingTile¶
public event EventHandler<SavingTileTileCacheEventArgs> SavingTile;
SavedTile¶
public event EventHandler<SavedTileTileCacheEventArgs> SavedTile;