|
Online Maps v3
|
Class for caching tiles in memory and the file system. More...
Classes | |
| class | CacheAtlas |
| Base class for cache atlas. More... | |
| class | CacheItem |
| Base class for cache item. More... | |
| class | CustomCacheAtlas |
| Custom cache atlas. More... | |
| class | CustomCacheItem |
| Custom cache item. More... | |
| class | FileCacheAtlas |
| File cache atlas. More... | |
| class | FileCacheItem |
| File cache item. More... | |
Public Types | |
| enum | CacheLocation { persistentDataPath , custom } |
| Location of the file cache. More... | |
Public Member Functions | |
| void | ClearAllCaches () |
| Clear all caches. | |
| OnlineMapsSavableItem[] | GetSavableItems () |
| Returns an array of items to save. | |
| delegate bool | OnGetFromCustomCacheDelegate (string key, out byte[] bytes) |
| Delegate of the event that occurs when you need to get data from the custom cache. | |
| void | AddItem (string key, byte[] bytes=null) |
| Saves data in custom cache by the key. | |
| void | ClearCustomCache () |
| Clear custom cache. | |
| int | GetCustomCacheSizeFast () |
| Fast way to get the size of the file cache. | |
| byte[] | GetItem (string key) |
| Returns value from custom cache by key. | |
| void | ClearFileCache () |
| Clear file cache. | |
| StringBuilder | GetFileCacheFolder () |
| Gets the file cache folder. | |
| int | GetFileCacheSizeFast () |
| Fast way to get the size of the file cache. | |
| StringBuilder | GetShortTilePath (OnlineMapsTile tile) |
| Get the relative path to the tile in the file cache. | |
| bool | GetTileTexture (OnlineMapsTile tile, OnlineMapsProvider.MapType mapType, out Texture2D texture) |
| Gets the tile texture from file cache. | |
| bool | TryLoadFromCache (OnlineMapsTile tile) |
| Try to load tile from file cache. | |
| void | ClearMemoryCache () |
| Clear memory cache. | |
Static Public Member Functions | |
| static void | Add (string key, byte[] bytes=null) |
| Saves data in custom cache by the key. | |
| static byte[] | Get (string key) |
| Returns value from custom cache by key. | |
Public Attributes | |
| Action< OnlineMapsTile > | OnLoadedFromCache |
| Event occurs when loading the tile from the file cache or memory cache. | |
| float | customCacheUnloadRate = 0.3f |
| Rate of unloaded tiles from the file cache (0-1). | |
| int | maxCustomCacheSize = 100 |
| The maximum size of the file cache (mb). | |
| Action< OnlineMapsTile > | OnLoadedFromFileCache |
| Event occurs when loading the tile from the file cache. | |
| CacheLocation | fileCacheLocation = CacheLocation.persistentDataPath |
| Location of the file cache. | |
| string | fileCacheCustomPath |
| Custom file cache path. | |
| string | fileCacheTilePath = "TileCache/{pid}/{mid}/{lbs}/{lng}/{zoom}/{x}/{y}" |
| Template file name in the file cache. | |
| float | fileCacheUnloadRate = 0.3f |
| Rate of unloaded tiles from the file cache (0-1). | |
| int | maxFileCacheSize = 100 |
| The maximum size of the file cache (mb). | |
| bool | useFileCache = true |
| Flag indicating that the file cache is used. | |
| Action< OnlineMapsTile > | OnLoadedFromMemoryCache |
| Event occurs when loading the tile from the memory cache. | |
| int | maxMemoryCacheSize = 10 |
| The maximum size of the memory cache (mb). | |
| float | memoryCacheUnloadRate = 0.3f |
| Rate of unloaded tiles from the memory cache (0-1). | |
| bool | useMemoryCache = true |
| Flag indicating that the memory cache is used. | |
Static Public Attributes | |
| static OnGetFromCustomCacheDelegate | OnGetFromCustomCache |
| Event that occurs when you need to get data from the custom cache. | |
Properties | |
| static OnlineMapsCache | instance [get] |
| The reference to an instance of the cache. | |
| int | customCacheSize [get] |
| Returns the size of the custom cache. | |
| int | fileCacheSize [get] |
| The current size of the file cache (mb). | |
| int | memoryCacheSize [get] |
| The current size of the memory cache (mb). | |
Class for caching tiles in memory and the file system.
|
static |
Saves data in custom cache by the key.
| key | The unique key of the value. |
| bytes | The value to be stored. |
| void OnlineMapsCache.AddItem | ( | string | key, |
| byte[] | bytes = null ) |
Saves data in custom cache by the key.
| key | The unique key of the value. |
| bytes | The value to be stored. |
|
static |
Returns value from custom cache by key.
| key | The unique key of the value. |
| int OnlineMapsCache.GetCustomCacheSizeFast | ( | ) |
Fast way to get the size of the file cache.
| StringBuilder OnlineMapsCache.GetFileCacheFolder | ( | ) |
Gets the file cache folder.
| int OnlineMapsCache.GetFileCacheSizeFast | ( | ) |
Fast way to get the size of the file cache.
| byte[] OnlineMapsCache.GetItem | ( | string | key | ) |
Returns value from custom cache by key.
| key | The unique key of the value. |
| OnlineMapsSavableItem[] OnlineMapsCache.GetSavableItems | ( | ) |
Returns an array of items to save.
Implements IOnlineMapsSavableComponent.
| StringBuilder OnlineMapsCache.GetShortTilePath | ( | OnlineMapsTile | tile | ) |
Get the relative path to the tile in the file cache.
| tile | Tile |
| bool OnlineMapsCache.GetTileTexture | ( | OnlineMapsTile | tile, |
| OnlineMapsProvider.MapType | mapType, | ||
| out Texture2D | texture ) |
Gets the tile texture from file cache.
| tile | Tile |
| mapType | Map Type |
| texture | Texture |
| bool OnlineMapsCache.TryLoadFromCache | ( | OnlineMapsTile | tile | ) |
Try to load tile from file cache.
| tile | Tile |