mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Removed MapTilerLayers.cs
This commit is contained in:
parent
176da3420d
commit
205b985f7c
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 },
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue