Removed MapTilerLayers.cs

This commit is contained in:
ClemensFischer 2025-02-11 13:11:05 +01:00
parent 176da3420d
commit 205b985f7c
6 changed files with 1 additions and 74 deletions

View file

@ -13,19 +13,15 @@ namespace SampleApplication
static MainWindow()
{
//MapProjectionFactory.Instance = new MapControl.Projections.GeoApiProjectionFactory();
//TileImageLoader.Cache = new MapControl.Caching.ImageFileCache(TileImageLoader.DefaultCacheFolder);
}
public MainWindow()
{
InitializeComponent();
AddMapTilerLayers();
AddTestLayers();
}
partial void AddMapTilerLayers();
partial void AddTestLayers();
private void MapItemsControlSelectionChanged(object sender, SelectionChangedEventArgs e)

View file

@ -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 },
}
});
}
}
}
}

View file

@ -17,19 +17,15 @@ namespace SampleApplication
static MainPage()
{
//MapProjectionFactory.Instance = new MapControl.Projections.GeoApiProjectionFactory();
//TileImageLoader.Cache = new MapControl.Caching.ImageFileCache(ApplicationData.Current.LocalCacheFolder);
}
public MainPage()
{
InitializeComponent();
AddMapTilerLayers();
AddTestLayers();
}
partial void AddMapTilerLayers();
partial void AddTestLayers();
private void MapItemsControlSelectionChanged(object sender, SelectionChangedEventArgs e)

View file

@ -51,9 +51,6 @@
<Compile Include="..\Shared\HyperlinkText.cs">
<Link>HyperlinkText.cs</Link>
</Compile>
<Compile Include="..\Shared\MapTilerLayers.cs">
<Link>MapTilerLayers.cs</Link>
</Compile>
<Compile Include="..\Shared\MapViewModel.cs">
<Link>MapViewModel.cs</Link>
</Compile>

View file

@ -16,21 +16,16 @@ namespace SampleApplication
static MainWindow()
{
//MapProjectionFactory.Instance = new MapControl.Projections.GeoApiProjectionFactory();
//TileImageLoader.Cache = new MapControl.Caching.ImageFileCache(TileImageLoader.DefaultCacheFolder);
}
public MainWindow()
{
InitializeComponent();
Title = "XAML Map Control - WinUI Sample Application";
AddMapTilerLayers();
AddTestLayers();
Title = "XAML Map Control - WinUI Sample Application";
}
partial void AddMapTilerLayers();
partial void AddTestLayers();
private void MapItemsControlSelectionChanged(object sender, SelectionChangedEventArgs e)

View file

@ -6,7 +6,6 @@ using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
namespace SampleApplication
{
@ -15,7 +14,6 @@ namespace SampleApplication
static MainWindow()
{
//MapProjectionFactory.Instance = new MapControl.Projections.GeoApiProjectionFactory();
//TileImageLoader.Cache = new MapControl.Caching.ImageFileCache(TileImageLoader.DefaultCacheFolder);
//TileImageLoader.Cache = new MapControl.Caching.FileDbCache(TileImageLoader.DefaultCacheFolder);
//TileImageLoader.Cache = new MapControl.Caching.SQLiteCache(TileImageLoader.DefaultCacheFolder);
@ -29,12 +27,9 @@ namespace SampleApplication
public MainWindow()
{
InitializeComponent();
AddMapTilerLayers();
AddTestLayers();
}
partial void AddMapTilerLayers();
partial void AddTestLayers();
private void MapItemsControlSelectionChanged(object sender, SelectionChangedEventArgs e)