mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 14:08:32 +00:00
MapProjectionFactory throws NotSupportedException
This commit is contained in:
parent
85cf0483ec
commit
45b9fb2e89
5 changed files with 48 additions and 23 deletions
|
|
@ -5,6 +5,7 @@
|
|||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
|
|
@ -101,9 +102,15 @@ namespace MapControl.UiTools
|
|||
{
|
||||
if (selectedProjection != projection)
|
||||
{
|
||||
selectedProjection = projection;
|
||||
Map.MapProjection = MapProjectionFactory.Instance.GetProjection(selectedProjection) ??
|
||||
throw new ArgumentException($"Can not create MapProjection \"{selectedProjection}\".");
|
||||
try
|
||||
{
|
||||
Map.MapProjection = MapProjectionFactory.Instance.GetProjection(projection);
|
||||
selectedProjection = projection;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"{nameof(MapProjectionFactory)}: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
UpdateCheckedStates();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue