mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-07 15:36:20 +00:00
MapMenuItems
This commit is contained in:
parent
ac97d2f7ed
commit
acecccf381
2 changed files with 25 additions and 27 deletions
|
|
@ -27,28 +27,23 @@ namespace MapControl.UiTools
|
|||
|
||||
protected override bool GetIsChecked(MapBase map)
|
||||
{
|
||||
return map.MapProjection.CrsId == MapProjection;
|
||||
return map.MapProjection.ToString() == MapProjection;
|
||||
}
|
||||
|
||||
public override Task Execute(MapBase map)
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
if (map.MapProjection.CrsId != MapProjection)
|
||||
if (!GetIsChecked(map))
|
||||
{
|
||||
try
|
||||
{
|
||||
map.MapProjection = MapProjectionFactory.Instance.GetProjection(MapProjection);
|
||||
map.MapProjection = MapControl.MapProjection.Parse(MapProjection);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"{nameof(MapProjectionFactory)}: {ex.Message}");
|
||||
success = false;
|
||||
Debug.WriteLine($"MapProjection.Parse: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
IsChecked = success;
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue