Table of Contents

Class FileRasterTileCache

Namespace
ThinkGeo.Core
Assembly
ThinkGeo.Core.dll

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
FileRasterTileCache
Derived
Inherited Members

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.

Properties

CacheDirectory

Gets or sets the cache direcory.

public string CacheDirectory { get; set; }

Property Value

string

Methods

ClearCache(double)

public void ClearCache(double maxSizeInMegabytes)

Parameters

maxSizeInMegabytes double

ClearCache(TimeSpan)

public void ClearCache(TimeSpan tileExpiration)

Parameters

tileExpiration TimeSpan

ClearCache(TimeSpan, double)

public void ClearCache(TimeSpan tileExpiration, double maxSizeInMegabytes)

Parameters

tileExpiration TimeSpan
maxSizeInMegabytes double

ClearCacheCore()

This method will clear all the tiles in the tileCache.

protected override void ClearCacheCore()

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 override 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.

GetTileAsyncCore(int, long, long, CancellationToken)

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

protected override Task<Tile> GetTileAsyncCore(int zoom, long column, long row, CancellationToken cancellationToken)

Parameters

zoom int
column long

The target column for the tileView to fetch.

row long

The target row for the tileView to fetch.

cancellationToken CancellationToken

Returns

Task<Tile>

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

GetTileCore(int, long, long)

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

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

Parameters

zoom int
column long

The target column for the tileView to fetch.

row long

The target row for the tileView to fetch.

Returns

Tile

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

SaveTileAsyncCore(Tile, CancellationToken)

protected override Task SaveTileAsyncCore(Tile tile, CancellationToken cancellationToken)

Parameters

tile Tile
cancellationToken CancellationToken

Returns

Task

SaveTileCore(Tile)

This method will save the target tileView passed in, you could override this API to create your own logic.

protected override void SaveTileCore(Tile tile)

Parameters

tile Tile

The target tileView to be saved.

ToString()

public override string ToString()

Returns

string