public async Task Initialize() { await tileData.OpenAsync(); var metadata = await tileData.ReadMetadataAsync(); string name; string description; string minzoom; string maxzoom; int minZoom; int maxZoom; if (metadata.TryGetValue("name", out name)) { Name = name; } if (metadata.TryGetValue("description", out description)) { Description = description; } if (metadata.TryGetValue("minzoom", out minzoom) && int.TryParse(minzoom, out minZoom)) { MinZoom = minZoom; } if (metadata.TryGetValue("maxzoom", out maxzoom) && int.TryParse(maxzoom, out maxZoom)) { MaxZoom = maxZoom; } }
public static async Task <MBTileData> CreateAsync(string file) { var tileData = new MBTileData(file); await tileData.OpenAsync(); await tileData.ReadMetadataAsync(); return(tileData); }