mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 22:18:56 +00:00
Removed MapTilerLayers.cs
This commit is contained in:
parent
176da3420d
commit
205b985f7c
6 changed files with 1 additions and 74 deletions
|
|
@ -1,52 +0,0 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using MapControl;
|
||||
using MapControl.UiTools;
|
||||
#if WPF
|
||||
using System.Windows.Media;
|
||||
#elif WINUI
|
||||
using Microsoft.UI;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif UWP
|
||||
using Windows.UI;
|
||||
using Windows.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Media;
|
||||
#endif
|
||||
|
||||
namespace SampleApplication
|
||||
{
|
||||
#if UWP
|
||||
public partial class MainPage
|
||||
#else
|
||||
public partial class MainWindow
|
||||
#endif
|
||||
{
|
||||
partial void AddMapTilerLayers()
|
||||
{
|
||||
#if UWP
|
||||
var mapTilerApiKeyPath = "MapTilerApiKey.txt";
|
||||
#else
|
||||
var mapTilerApiKeyPath = Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MapControl", "MapTilerApiKey.txt");
|
||||
#endif
|
||||
if (File.Exists(mapTilerApiKeyPath))
|
||||
{
|
||||
string apiKey = File.ReadAllText(mapTilerApiKeyPath)?.Trim();
|
||||
|
||||
mapLayersMenuButton.MapLayers.Add(new MapLayerItem
|
||||
{
|
||||
Text = "MapTiler Satellite",
|
||||
Layer = new MapTileLayer
|
||||
{
|
||||
TileSource = new TileSource { UriTemplate = "https://api.maptiler.com/maps/satellite/{z}/{x}/{y}.jpg?key=" + apiKey },
|
||||
SourceName = "MapTiler Satellite",
|
||||
Description = "© [MapTiler](https://www.maptiler.com/)",
|
||||
MapBackground = new SolidColorBrush { Color = Colors.Black },
|
||||
MapForeground = new SolidColorBrush { Color = Colors.White },
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue