mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 14:08:32 +00:00
Added MapProjectionFactory
This commit is contained in:
parent
67b87acb44
commit
e2fcc1db2c
12 changed files with 87 additions and 17 deletions
|
|
@ -26,7 +26,7 @@ namespace MapControl.UiTools
|
|||
public class MapProjectionItem
|
||||
{
|
||||
public string Text { get; set; }
|
||||
public MapProjection Projection { get; set; }
|
||||
public string Projection { get; set; }
|
||||
}
|
||||
|
||||
#if WINUI || UWP
|
||||
|
|
@ -77,18 +77,18 @@ namespace MapControl.UiTools
|
|||
private void MapProjectionClicked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var item = (FrameworkElement)sender;
|
||||
var projection = (MapProjection)item.Tag;
|
||||
var projection = (string)item.Tag;
|
||||
|
||||
SetMapProjection(projection);
|
||||
}
|
||||
|
||||
private void SetMapProjection(MapProjection projection)
|
||||
private void SetMapProjection(string projection)
|
||||
{
|
||||
Map.MapProjection = projection;
|
||||
Map.MapProjection = MapProjection.Factory.CreateProjection(projection);
|
||||
|
||||
foreach (var item in GetMenuItems())
|
||||
{
|
||||
item.IsChecked = Map.MapProjection == (MapProjection)item.Tag;
|
||||
item.IsChecked = projection == (string)item.Tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue