FileRasterTileCache¶
Namespace: ThinkGeo.Core
This class is a concrete class inherits from BitmapTileCache. In this class, the tiles will be saved in disk and can be viewed very conveniently.
public class FileRasterTileCache : RasterTileCache
Inheritance Object → TileCache → RasterTileCache → FileRasterTileCache
Properties¶
CacheDirectory¶
Gets or sets the cache direcory.
public string CacheDirectory { get; set; }
Property Value¶
NoDataTileImage¶
This property returns back a preset image showing the tileView data is missing.
public GeoImage NoDataTileImage { get; }
Property Value¶
LoadingTileImage¶
This property returns back a preset image showing the Tile is loading.
public GeoImage LoadingTileImage { get; }
Property Value¶
ImageFormat¶
Gets or sets the tileView image format.
public GeoImageFormat ImageFormat { get; set; }
Property Value¶
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¶
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¶
Constructors¶
FileRasterTileCache()¶
This is the default constructor.
public FileRasterTileCache()
Remarks:
If you use this constructor, you have to set the properties manually.
FileRasterTileCache(String)¶
This is the overloads constructor.
public FileRasterTileCache(string cacheDirectory)
Parameters¶
cacheDirectory String
This parameter specifies the cache directory of the tileView cache.
Remarks:
If you use this constructor, the other properties are set with default values.
FileRasterTileCache(String, String)¶
This is the overloads constructor.
public FileRasterTileCache(string cacheDirectory, string cacheId)
Parameters¶
cacheDirectory String
This parameter specifies the cache directory of the tileView cache.
cacheId String
This parameter specifies the cache id of the tileView cache.
Remarks:
If you use this constructor, the other properties are set with default values.
FileRasterTileCache(String, String, GeoImageFormat)¶
This is the constructor with all the parameters needed passed in.
public FileRasterTileCache(string cacheDirectory, string cacheId, GeoImageFormat imageFormat)
Parameters¶
cacheDirectory String
This parameter specifies the cache directory of the tileView cache.
cacheId String
This parameter specifies the cache id of the tileView cache.
imageFormat GeoImageFormat
This parameter specifies the image format of the tileView cahce.
Methods¶
GetTileCore(Int32, Int64, Int64)¶
This method returns the BitmapTile corresponding to passed in row and column.
protected Tile GetTileCore(int zoom, long x, long y)
Parameters¶
zoom Int32
x Int64
y Int64
Returns¶
Tile
Returns the BitmapTile corresponding to the passed in row and column.
GetTileAsyncCore(Int32, Int64, Int64, CancellationToken)¶
This method returns the BitmapTile corresponding to passed in row and column.
protected Task<Tile> GetTileAsyncCore(int zoom, long x, long y, CancellationToken cancellationToken)
Parameters¶
zoom Int32
x Int64
The target column for the tileView to fetch.
y Int64
The target row for the tileView to fetch.
cancellationToken CancellationToken
Returns¶
Task<Tile>
Returns the BitmapTile corresponding to the passed in row and column.
SaveTileCore(Tile)¶
This method will save the target tileView passed in, you could override this API to create your own logic.
protected void SaveTileCore(Tile tile)
Parameters¶
tile Tile
The target tileView to be saved.
SaveTileAsyncCore(Tile, CancellationToken)¶
protected Task SaveTileAsyncCore(Tile tile, CancellationToken cancellationToken)
Parameters¶
tile Tile
cancellationToken CancellationToken
Returns¶
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.
CheckExpiration(String)¶
internal bool CheckExpiration(string tileImageFileName)
Parameters¶
tileImageFileName String
Returns¶
ClearCache(TimeSpan)¶
public void ClearCache(TimeSpan tileExpiration)
Parameters¶
tileExpiration TimeSpan
ClearCache(Double)¶
public void ClearCache(double maxSizeInMegabytes)
Parameters¶
maxSizeInMegabytes Double
ClearCache(TimeSpan, Double)¶
public void ClearCache(TimeSpan tileExpiration, double maxSizeInMegabytes)
Parameters¶
tileExpiration TimeSpan
maxSizeInMegabytes Double
ToString()¶
public string ToString()
Returns¶
ClearCacheCore()¶
This method will clear all the tiles in the tileCache.
protected void ClearCacheCore()
GetCacheFilePath(Int32, Int64, Int64)¶
public string GetCacheFilePath(int zoom, long x, long y)
Parameters¶
zoom Int32
x Int64
y Int64
Returns¶
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;