mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Update ProjectionDemo
This commit is contained in:
parent
3a9050676c
commit
ee985aa777
|
|
@ -1,11 +1,9 @@
|
||||||
using MapControl;
|
using MapControl;
|
||||||
using MapControl.Projections;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
|
|
@ -13,19 +11,17 @@ namespace ProjectionDemo
|
||||||
{
|
{
|
||||||
public partial class MainWindow : Window
|
public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
private readonly HttpClient httpClient = new HttpClient();
|
private readonly ViewModel viewModel = new();
|
||||||
private readonly ViewModel viewModel = new ViewModel();
|
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
viewModel.Projections.Add(new MapControl.Projections.WebMercatorProjection());
|
viewModel.Projections.Add(new WebMercatorProjection());
|
||||||
|
viewModel.Projections.Add(new Etrs89UtmProjection(32));
|
||||||
viewModel.Projections.Add(new GeoApiProjection(await httpClient.GetStringAsync("https://epsg.io/25832.wkt"))); // ETRS89 / UTM zone 32N
|
|
||||||
|
|
||||||
viewModel.Layers.Add(
|
viewModel.Layers.Add(
|
||||||
"OpenStreetMap WMS",
|
"OpenStreetMap WMS",
|
||||||
|
|
@ -70,7 +66,7 @@ namespace ProjectionDemo
|
||||||
{
|
{
|
||||||
private MapProjection currentProjection;
|
private MapProjection currentProjection;
|
||||||
private IMapLayer currentLayer;
|
private IMapLayer currentLayer;
|
||||||
private Location pushpinLocation = new Location();
|
private Location pushpinLocation = new();
|
||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<TargetFramework>net6.0-windows</TargetFramework>
|
<TargetFramework>net7.0-windows</TargetFramework>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<RootNamespace>ProjectionDemo</RootNamespace>
|
<RootNamespace>ProjectionDemo</RootNamespace>
|
||||||
<AssemblyTitle>XAML Map Control Projection Demo Application</AssemblyTitle>
|
<AssemblyTitle>XAML Map Control Projection Demo Application</AssemblyTitle>
|
||||||
|
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\MapControl\WPF\MapControl.WPF.csproj" />
|
<ProjectReference Include="..\..\MapControl\WPF\MapControl.WPF.csproj" />
|
||||||
<ProjectReference Include="..\..\MapProjections\WPF\MapProjections.WPF.csproj" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
Loading…
Reference in a new issue