Example #1
0
 public static ITileSource CreateTileSource(TileSetConfiguration configuration)
 {
     if (Utils.IsLocalFileScheme(configuration.Source))
     {
         return(new LocalTileSource(configuration));
     }
     else
     {
         return(null);
     }
 }
Example #2
0
        public MBTilesTileSource(TileSetConfiguration configuration)
        {
            this.configuration = configuration;
            this.contentType   = Utils.GetContentType(this.configuration.Format); // TODO: from db metadata

            if (this.configuration.UseCoordinatesCache)
            {
                var filePath = GetLocalFilePath(this.configuration.Source);
                if (File.Exists(filePath))
                {
                    // TODO: not the best placement in constructor
                    Task.Run(() =>
                    {
                        var connectionString = GetMBTilesConnectionString(this.configuration.Source);
                        var db = new MBTilesRepository(connectionString);
                        db.ReadTileCoordinatesAsync(this.tileKeys).Wait(); // TODO: check presence of rowid
                        this.isTileKeysReady = true;
                    });
                }
            }
        }
Example #3
0
 public LocalTileSource(TileSetConfiguration configuration)
 {
     this.configuration = configuration;
     this.contentType   = Utils.GetContentType(this.configuration.Format);
 }