mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-20 22:05:07 +00:00
throw ArgumentException when projection could not be created
This commit is contained in:
parent
8e835e5475
commit
85cf0483ec
2 changed files with 5 additions and 3 deletions
|
|
@ -166,7 +166,7 @@ namespace MapControl
|
||||||
var epsgCode = geoKeyDirectory[i + 3];
|
var epsgCode = geoKeyDirectory[i + 3];
|
||||||
|
|
||||||
mapProjection = MapProjectionFactory.Instance.GetProjection($"EPSG:{epsgCode}") ??
|
mapProjection = MapProjectionFactory.Instance.GetProjection($"EPSG:{epsgCode}") ??
|
||||||
throw new ArgumentException($"Can not create projection EPSG:{epsgCode}.");
|
throw new ArgumentException($"Can not create MapProjection \"EPSG:{epsgCode}\".");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
// Copyright © 2024 Clemens Fischer
|
// Copyright © 2024 Clemens Fischer
|
||||||
// Licensed under the Microsoft Public License (Ms-PL)
|
// Licensed under the Microsoft Public License (Ms-PL)
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
@ -25,7 +26,7 @@ namespace MapControl.UiTools
|
||||||
{
|
{
|
||||||
#if WPF
|
#if WPF
|
||||||
[ContentProperty(nameof(Projection))]
|
[ContentProperty(nameof(Projection))]
|
||||||
#elif UWP || WINUI
|
#elif UWP || WINUI
|
||||||
[ContentProperty(Name = nameof(Projection))]
|
[ContentProperty(Name = nameof(Projection))]
|
||||||
#endif
|
#endif
|
||||||
public class MapProjectionItem
|
public class MapProjectionItem
|
||||||
|
|
@ -101,7 +102,8 @@ namespace MapControl.UiTools
|
||||||
if (selectedProjection != projection)
|
if (selectedProjection != projection)
|
||||||
{
|
{
|
||||||
selectedProjection = projection;
|
selectedProjection = projection;
|
||||||
Map.MapProjection = MapProjectionFactory.Instance.GetProjection(selectedProjection);
|
Map.MapProjection = MapProjectionFactory.Instance.GetProjection(selectedProjection) ??
|
||||||
|
throw new ArgumentException($"Can not create MapProjection \"{selectedProjection}\".");
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateCheckedStates();
|
UpdateCheckedStates();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue