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 RasterTileFormat 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, RasterTileFormat)¶
This is the constructor with all the parameters needed passed in.
public FileRasterTileCache(string cacheDirectory, string cacheId, RasterTileFormat 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
RasterTileFormat
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 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, you could override this API to create your own logic.
protected void SaveTileCore(Tile tile)
Parameters¶
tile
Tile
The target tileView to be saved.
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.
WB0=(String)¶
internal bool WB0=(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()
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;