Class FileCacheProvider
Inherited Members
Namespace: OffRouteMap
Assembly: OffRouteMap.dll
Syntax
public class FileCacheProvider : PureImageCache, IDisposable
Constructors
| Edit this page View SourceFileCacheProvider(string, long)
Declaration
public FileCacheProvider(string rootPath, long maxCacheBytes = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| string | rootPath | |
| long | maxCacheBytes |
Methods
| Edit this page View SourceDeleteOlderThan(DateTime, int?)
delete files older than date; if type != null, limit to that subfolder returns number of deleted tiles
Declaration
public int DeleteOlderThan(DateTime date, int? type)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | date | |
| int? | type |
Returns
| Type | Description |
|---|---|
| int |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
GetImageFromCache(int, GPoint, int)
Load map tile from file cache.
Declaration
public PureImage GetImageFromCache(int type, GPoint pos, int zoom)
Parameters
| Type | Name | Description |
|---|---|---|
| int | type | |
| GPoint | pos | |
| int | zoom |
Returns
| Type | Description |
|---|---|
| PureImage | tile as pureImage or null on fail |
PutImageToCache(byte[], int, GPoint, int)
Store map tile as file.
Declaration
public bool PutImageToCache(byte[] tile, int type, GPoint pos, int zoom)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | tile | raw image bytes (png/jpg) |
| int | type | provider-specific type (can be ignored or used to subfolder) |
| GPoint | pos | |
| int | zoom |
Returns
| Type | Description |
|---|---|
| bool | false on error |
Implements
GMap.NET.PureImageCache