Update MainWindow.xaml.cs

This commit is contained in:
Clemens 2021-11-17 21:35:58 +01:00
parent 938b03efa1
commit 97171d201e

View file

@ -18,14 +18,14 @@ namespace SampleApplication
{ {
ImageLoader.HttpClient.DefaultRequestHeaders.Add("User-Agent", "XAML Map Control Test Application"); ImageLoader.HttpClient.DefaultRequestHeaders.Add("User-Agent", "XAML Map Control Test Application");
var bingMapsApiKeyFile = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MapControl", "BingMapsApiKey.txt");
BingMapsTileLayer.ApiKey = File.ReadAllText(bingMapsApiKeyFile)?.Trim();
//TileImageLoader.Cache = new ImageFileCache(TileImageLoader.DefaultCacheFolder); //TileImageLoader.Cache = new ImageFileCache(TileImageLoader.DefaultCacheFolder);
//TileImageLoader.Cache = new FileDbCache(TileImageLoader.DefaultCacheFolder); //TileImageLoader.Cache = new FileDbCache(TileImageLoader.DefaultCacheFolder);
//TileImageLoader.Cache = new SQLiteCache(TileImageLoader.DefaultCacheFolder); //TileImageLoader.Cache = new SQLiteCache(TileImageLoader.DefaultCacheFolder);
var bingMapsApiKeyPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MapControl", "BingMapsApiKey.txt");
BingMapsTileLayer.ApiKey = File.ReadAllText(bingMapsApiKeyPath)?.Trim();
} }
catch (Exception ex) catch (Exception ex)
{ {