2024-05-24 15:28:28 +02:00
|
|
|
|
using Avalonia.Controls;
|
|
|
|
|
|
using Avalonia.Input;
|
|
|
|
|
|
using MapControl;
|
2024-05-31 10:40:29 +02:00
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
|
using System.Linq;
|
2024-05-24 15:28:28 +02:00
|
|
|
|
|
2024-05-27 11:10:10 +02:00
|
|
|
|
namespace SampleApplication
|
2024-05-24 15:28:28 +02:00
|
|
|
|
{
|
|
|
|
|
|
public partial class MainWindow : Window
|
|
|
|
|
|
{
|
|
|
|
|
|
static MainWindow()
|
|
|
|
|
|
{
|
|
|
|
|
|
//TileImageLoader.Cache = new MapControl.Caching.ImageFileCache(TileImageLoader.DefaultCacheFolder);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public MainWindow()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
2024-06-30 16:21:36 +02:00
|
|
|
|
AddBingMapsLayers();
|
2024-05-29 17:19:03 +02:00
|
|
|
|
AddTestLayers();
|
2024-05-28 18:56:28 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-06-30 16:21:36 +02:00
|
|
|
|
partial void AddBingMapsLayers();
|
2024-05-29 17:19:03 +02:00
|
|
|
|
partial void AddTestLayers();
|
2024-05-28 18:56:28 +02:00
|
|
|
|
|
2024-05-31 22:45:50 +02:00
|
|
|
|
private void MapItemsControlSelectionChanged(object sender, SelectionChangedEventArgs e)
|
2024-05-31 10:40:29 +02:00
|
|
|
|
{
|
|
|
|
|
|
Debug.WriteLine("SelectedItems: " + string.Join(", ", ((MapItemsControl)sender).SelectedItems.OfType<PointItem>().Select(item => item.Name)));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-05-31 09:17:44 +02:00
|
|
|
|
private void MapItemsControlDoubleTapped(object sender, TappedEventArgs e)
|
2024-05-29 20:29:45 +02:00
|
|
|
|
{
|
2024-05-31 09:17:44 +02:00
|
|
|
|
e.Handled = true; // prevent MapDoubleTapped
|
2024-05-29 20:29:45 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-05-31 09:17:44 +02:00
|
|
|
|
private void MapDoubleTapped(object sender, TappedEventArgs e)
|
2024-05-28 18:56:28 +02:00
|
|
|
|
{
|
2024-05-29 17:19:03 +02:00
|
|
|
|
map.TargetCenter = map.ViewToLocation(e.GetPosition(map));
|
2024-05-28 18:56:28 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-05-29 17:19:03 +02:00
|
|
|
|
private void ResetHeadingButtonClick(object sender, Avalonia.Interactivity.RoutedEventArgs e)
|
2024-05-28 18:56:28 +02:00
|
|
|
|
{
|
2024-05-29 17:19:03 +02:00
|
|
|
|
map.TargetHeading = 0d;
|
2024-05-24 15:28:28 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|