mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Updated ProjectionDemo
This commit is contained in:
parent
8745bb9660
commit
fdfa8348eb
|
|
@ -4,8 +4,15 @@
|
|||
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">
|
||||
<Grid>
|
||||
<map:Map MaxZoomLevel="22" ZoomLevel="10" Center="50.1,8.25" MapLayer="{Binding CurrentLayer}"
|
||||
MapProjection="{Binding CurrentProjection}"
|
||||
MouseRightButtonUp="Map_MouseRightButtonUp">
|
||||
|
||||
<map:Pushpin map:MapPanel.Location="{Binding PushpinLocation}"
|
||||
Content="{Binding PushpinText}"/>
|
||||
</map:Map>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="4">
|
||||
<ComboBox Margin="2"
|
||||
ItemsSource="{Binding Projections}"
|
||||
SelectedItem="{Binding CurrentProjection}"
|
||||
|
|
@ -16,19 +23,5 @@
|
|||
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>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -39,12 +39,20 @@ namespace ProjectionDemo
|
|||
WmsLayers = "web"
|
||||
});
|
||||
|
||||
viewModel.Layers.Add(
|
||||
"Basemap.de WMS",
|
||||
new WmsImageLayer
|
||||
{
|
||||
ServiceUri = new Uri("https://sgx.geodatenzentrum.de/wms_basemapde"),
|
||||
WmsLayers = "de_basemapde_web_raster_farbe"
|
||||
});
|
||||
|
||||
viewModel.Layers.Add(
|
||||
"Orthophotos Wiesbaden",
|
||||
new WmsImageLayer
|
||||
{
|
||||
ServiceUri = new Uri("https://geoportal.wiesbaden.de/cgi-bin/mapserv.fcgi?map=d:/openwimap/umn/map/orthophoto/orthophotos.map"),
|
||||
WmsLayers = "orthophoto2017"
|
||||
WmsLayers = "orthophoto2023"
|
||||
});
|
||||
|
||||
viewModel.CurrentProjection = viewModel.Projections[0];
|
||||
|
|
@ -70,9 +78,9 @@ namespace ProjectionDemo
|
|||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public List<MapProjection> Projections { get; } = new List<MapProjection>();
|
||||
public List<MapProjection> Projections { get; } = [];
|
||||
|
||||
public Dictionary<string, IMapLayer> Layers { get; } = new Dictionary<string, IMapLayer>();
|
||||
public Dictionary<string, IMapLayer> Layers { get; } = [];
|
||||
|
||||
public MapProjection CurrentProjection
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue