/// <summary> /// Creates a new tiles layer. /// </summary> /// <param name="connection">The SQLite connection to the MBTiles.</param> /// <param name="tileCacheSize">The size of tiles to cache.</param> public LayerMBTile(SQLiteConnectionBase connection, int tileCacheSize) { _nativeImageCache = NativeImageCacheFactory.Create(); _connection = connection; _cache = new LRUCache <Tile, Image2D>(tileCacheSize); _cache.OnRemove += OnRemove; _projection = new WebMercator(); }
/// <summary> /// Creates a new tiles layer. /// </summary> /// <param name="tilesURL">The tiles URL.</param> /// <param name="tileCacheSize">The tile cache size.</param> public LayerTile(string tilesURL, int tileCacheSize) { _nativeImageCache = NativeImageCacheFactory.Create(); _tilesURL = tilesURL; _cache = new LRUCache <Tile, Image2D>(tileCacheSize); _cache.OnRemove += OnRemove; _stack = new LimitedStack <Tile>(tileCacheSize, tileCacheSize); _timer = new Timer(this.LoadQueuedTiles, null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite); _attempts = new Dictionary <Tile, int>(); _suspended = false; _projection = new WebMercator(); }