XAML-Map-Control/SampleApps/ProjectionDemo/MainWindow.xaml

35 lines
1.5 KiB
Plaintext
Raw Normal View History

2020-03-25 16:13:50 +01:00
<Window x:Class="ProjectionDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:map="clr-namespace:MapControl;assembly=MapControl.WPF"
Title="XAML MapControl - Projection Demo" Height="600" Width="800"
Loaded="Window_Loaded">
<DockPanel>
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal">
<ComboBox Margin="2"
ItemsSource="{Binding Projections}"
SelectedItem="{Binding CurrentProjection}"
DisplayMemberPath="CrsId"/>
<ComboBox Margin="2"
ItemsSource="{Binding Layers}"
SelectedValue="{Binding CurrentLayer}"
SelectedValuePath="Value"
DisplayMemberPath="Key"/>
</StackPanel>
<map:Map MaxZoomLevel="22" ZoomLevel="8" Center="50,8" MapLayer="{Binding CurrentLayer}"
MouseRightButtonUp="Map_MouseRightButtonUp">
<map:MapBase.MapProjection>
<Binding Path="CurrentProjection">
<Binding.FallbackValue>
<map:WebMercatorProjection/>
</Binding.FallbackValue>
</Binding>
</map:MapBase.MapProjection>
<map:Pushpin map:MapPanel.Location="{Binding PushpinLocation}"
Content="{Binding PushpinText}"/>
</map:Map>
</DockPanel>
</Window>