2015-08-09 20:04:44 +02:00
|
|
|
<Page
|
|
|
|
|
x:Class="UniversalApp.MainPage"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:map="using:MapControl"
|
|
|
|
|
xmlns:local="using:UniversalApp">
|
|
|
|
|
|
|
|
|
|
<Page.Resources>
|
|
|
|
|
<DataTemplate x:Key="PolylineItemTemplate">
|
|
|
|
|
<map:MapPolyline Locations="{Binding Locations}" Stroke="Red" StrokeThickness="3"/>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
|
|
|
|
<Style x:Key="PolylineItemStyle" TargetType="map:MapItem">
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="map:MapItem">
|
|
|
|
|
<map:MapPolyline Locations="{Binding Locations}" Stroke="Red" StrokeThickness="3"/>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
<Style x:Key="PointItemStyle" TargetType="map:MapItem">
|
2021-01-11 22:35:17 +01:00
|
|
|
<Setter Property="LocationMemberPath" Value="Location"/>
|
2015-08-09 20:04:44 +02:00
|
|
|
<Setter Property="Foreground" Value="Black"/>
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="map:MapItem">
|
|
|
|
|
<Canvas>
|
|
|
|
|
<VisualStateManager.VisualStateGroups>
|
|
|
|
|
<VisualStateGroup x:Name="CommonStates">
|
|
|
|
|
<VisualState x:Name="Normal"/>
|
|
|
|
|
<VisualState x:Name="Disabled"/>
|
2016-08-08 20:36:02 +02:00
|
|
|
<VisualState x:Name="PointerOver"/>
|
|
|
|
|
<VisualState x:Name="Pressed"/>
|
2015-08-09 20:04:44 +02:00
|
|
|
<VisualState x:Name="Selected">
|
|
|
|
|
<Storyboard>
|
2016-08-08 20:36:02 +02:00
|
|
|
<DoubleAnimation Storyboard.TargetName="selectedPath" Storyboard.TargetProperty="Opacity" To="0.75" Duration="0"/>
|
2015-08-09 20:04:44 +02:00
|
|
|
</Storyboard>
|
|
|
|
|
</VisualState>
|
2016-08-08 20:36:02 +02:00
|
|
|
<VisualState x:Name="SelectedUnfocused">
|
2015-08-09 20:04:44 +02:00
|
|
|
<Storyboard>
|
2016-08-08 20:36:02 +02:00
|
|
|
<DoubleAnimation Storyboard.TargetName="selectedPath" Storyboard.TargetProperty="Opacity" To="0.75" Duration="0"/>
|
2015-08-09 20:04:44 +02:00
|
|
|
</Storyboard>
|
|
|
|
|
</VisualState>
|
2016-08-08 20:36:02 +02:00
|
|
|
<VisualState x:Name="SelectedPointerOver">
|
2015-08-09 20:04:44 +02:00
|
|
|
<Storyboard>
|
2016-08-08 20:36:02 +02:00
|
|
|
<DoubleAnimation Storyboard.TargetName="selectedPath" Storyboard.TargetProperty="Opacity" To="0.75" Duration="0"/>
|
2015-08-09 20:04:44 +02:00
|
|
|
</Storyboard>
|
|
|
|
|
</VisualState>
|
|
|
|
|
<VisualState x:Name="SelectedPressed">
|
|
|
|
|
<Storyboard>
|
2016-08-08 20:36:02 +02:00
|
|
|
<DoubleAnimation Storyboard.TargetName="selectedPath" Storyboard.TargetProperty="Opacity" To="0.75" Duration="0"/>
|
2015-08-09 20:04:44 +02:00
|
|
|
</Storyboard>
|
|
|
|
|
</VisualState>
|
|
|
|
|
</VisualStateGroup>
|
|
|
|
|
</VisualStateManager.VisualStateGroups>
|
|
|
|
|
<Path x:Name="selectedPath" Fill="White" Opacity="0">
|
|
|
|
|
<Path.Data>
|
|
|
|
|
<EllipseGeometry RadiusX="15" RadiusY="15"/>
|
|
|
|
|
</Path.Data>
|
|
|
|
|
</Path>
|
|
|
|
|
<Path Fill="Transparent" Stroke="Gray" StrokeThickness="2">
|
|
|
|
|
<Path.Data>
|
|
|
|
|
<EllipseGeometry RadiusX="8" RadiusY="8"/>
|
|
|
|
|
</Path.Data>
|
|
|
|
|
</Path>
|
|
|
|
|
<Grid Canvas.Left="15" Canvas.Top="-8">
|
|
|
|
|
<Rectangle x:Name="labelBackground" Fill="White" Opacity="0.7"/>
|
|
|
|
|
<TextBlock Margin="2,0,2,0" Text="{Binding Name}"/>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Canvas>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
<Style x:Key="PushpinItemStyle" TargetType="map:MapItem">
|
2021-01-11 22:35:17 +01:00
|
|
|
<Setter Property="LocationMemberPath" Value="Location"/>
|
2015-08-09 20:04:44 +02:00
|
|
|
<Setter Property="VerticalAlignment" Value="Bottom"/>
|
|
|
|
|
<Setter Property="Foreground" Value="Black"/>
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="map:MapItem">
|
|
|
|
|
<map:Pushpin Content="{Binding Name}"/>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
|
2017-06-25 23:05:48 +02:00
|
|
|
<map:WebMercatorProjection x:Key="WebMercatorProjection"/>
|
2017-10-27 17:15:18 +02:00
|
|
|
<map:WorldMercatorProjection x:Key="WorldMercatorProjection"/>
|
2017-06-25 23:05:48 +02:00
|
|
|
<map:EquirectangularProjection x:Key="EquirectangularProjection"/>
|
|
|
|
|
<map:OrthographicProjection x:Key="OrthographicProjection"/>
|
|
|
|
|
<map:GnomonicProjection x:Key="GnomonicProjection"/>
|
|
|
|
|
<map:StereographicProjection x:Key="StereographicProjection"/>
|
|
|
|
|
</Page.Resources>
|
2015-08-09 20:04:44 +02:00
|
|
|
|
|
|
|
|
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition/>
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
</Grid.RowDefinitions>
|
2017-06-25 23:05:48 +02:00
|
|
|
<map:Map x:Name="map" MinZoomLevel="2" MaxZoomLevel="20" ZoomLevel="11" ManipulationMode="All"
|
|
|
|
|
Center="{x:Bind ViewModel.MapCenter, Mode=TwoWay}"
|
|
|
|
|
MapLayer="{x:Bind ViewModel.MapLayers.CurrentMapLayer, Mode=OneWay}"
|
|
|
|
|
MapProjection="{Binding SelectedValue, ElementName=projectionComboBox,
|
|
|
|
|
FallbackValue={StaticResource WebMercatorProjection},
|
|
|
|
|
TargetNullValue={StaticResource WebMercatorProjection}}">
|
2016-02-23 20:07:30 +01:00
|
|
|
|
2017-06-25 23:05:48 +02:00
|
|
|
<Image x:Name="mapImage" Source="10_535_330.jpg" Opacity="0.5" Stretch="Fill">
|
|
|
|
|
<map:MapPanel.BoundingBox>
|
|
|
|
|
<map:BoundingBox South="53.54031" North="53.74871" West="8.08594" East="8.43750"/>
|
|
|
|
|
</map:MapPanel.BoundingBox>
|
|
|
|
|
</Image>
|
2016-02-23 20:07:30 +01:00
|
|
|
|
2017-06-25 23:05:48 +02:00
|
|
|
<map:MapGraticule x:Name="mapGraticule" Opacity="0.6"/>
|
2018-04-30 23:13:50 +02:00
|
|
|
<map:MapScale HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
|
2015-08-09 20:04:44 +02:00
|
|
|
|
|
|
|
|
<!-- use ItemTemplate or ItemContainerStyle alternatively -->
|
|
|
|
|
<map:MapItemsControl ItemsSource="{Binding Polylines}"
|
|
|
|
|
ItemTemplate="{StaticResource PolylineItemTemplate}"/>
|
|
|
|
|
<!--<map:MapItemsControl ItemsSource="{Binding Polylines}"
|
|
|
|
|
ItemContainerStyle="{StaticResource PolylineItemStyle}"/>-->
|
|
|
|
|
|
|
|
|
|
<map:MapItemsControl ItemsSource="{Binding Points}"
|
|
|
|
|
ItemContainerStyle="{StaticResource PointItemStyle}"
|
|
|
|
|
SelectionMode="Extended"/>
|
|
|
|
|
|
|
|
|
|
<map:MapItemsControl ItemsSource="{Binding Pushpins}"
|
|
|
|
|
ItemContainerStyle="{StaticResource PushpinItemStyle}"/>
|
|
|
|
|
|
|
|
|
|
<map:Pushpin Background="Yellow" Foreground="Blue" Content="N 53° 30' E 8° 12'">
|
|
|
|
|
<map:MapPanel.Location>
|
|
|
|
|
<map:Location Latitude="53.5" Longitude="8.2"/>
|
|
|
|
|
</map:MapPanel.Location>
|
|
|
|
|
</map:Pushpin>
|
|
|
|
|
</map:Map>
|
2016-04-19 19:36:03 +02:00
|
|
|
|
2015-08-09 20:04:44 +02:00
|
|
|
<Border HorizontalAlignment="Right" VerticalAlignment="Bottom" Background="#BFFFFFFF">
|
|
|
|
|
<TextBlock Margin="2" FontSize="10" Foreground="Black"
|
2017-06-25 23:05:48 +02:00
|
|
|
map:HyperlinkText.InlinesSource="{Binding MapLayers.CurrentMapLayer.Description}"/>
|
2015-08-09 20:04:44 +02:00
|
|
|
</Border>
|
2016-04-19 19:36:03 +02:00
|
|
|
|
2015-08-09 20:04:44 +02:00
|
|
|
<Grid Grid.Row="1">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition/>
|
|
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
|
|
|
|
<StackPanel Margin="5">
|
|
|
|
|
<TextBlock Text="Zoom Level" HorizontalAlignment="Center" Foreground="Gray" FontSize="14"/>
|
2017-06-25 23:05:48 +02:00
|
|
|
<Slider Margin="10,-10,10,-10" Width="100" SmallChange="0.1"
|
2015-08-09 20:04:44 +02:00
|
|
|
Minimum="{Binding MinZoomLevel, ElementName=map}"
|
|
|
|
|
Maximum="{Binding MaxZoomLevel, ElementName=map}"
|
|
|
|
|
Value="{Binding TargetZoomLevel, ElementName=map, Mode=TwoWay}"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
<StackPanel Margin="5">
|
|
|
|
|
<TextBlock Text="Heading" HorizontalAlignment="Center" Foreground="Gray" FontSize="14"/>
|
2017-06-25 23:05:48 +02:00
|
|
|
<Slider Margin="10,-10,10,-10" Width="100" Minimum="0" Maximum="360" SmallChange="5" LargeChange="45"
|
2015-08-09 20:04:44 +02:00
|
|
|
Value="{Binding Heading, ElementName=map, Mode=TwoWay}"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
<StackPanel Margin="5">
|
|
|
|
|
<TextBlock Text="Image Opacity" HorizontalAlignment="Center" Foreground="Gray" FontSize="14"/>
|
2017-06-25 23:05:48 +02:00
|
|
|
<Slider Margin="10,-10,10,-10" Width="100" Value="50" ValueChanged="ImageOpacitySliderValueChanged"/>
|
2015-08-09 20:04:44 +02:00
|
|
|
</StackPanel>
|
|
|
|
|
<CheckBox Margin="10" VerticalAlignment="Center" Content="Seamarks"
|
|
|
|
|
Checked="SeamarksChecked" Unchecked="SeamarksUnchecked"/>
|
2017-06-25 23:05:48 +02:00
|
|
|
<ComboBox Width="250" Margin="10" VerticalAlignment="Center"
|
|
|
|
|
ItemsSource="{Binding MapLayers.MapLayerNames}"
|
|
|
|
|
SelectedItem="{Binding MapLayers.CurrentMapLayerName, Mode=TwoWay}"/>
|
|
|
|
|
<ComboBox x:Name="projectionComboBox" Width="150" Margin="10" VerticalAlignment="Bottom"
|
|
|
|
|
SelectedIndex="0" SelectedValuePath="Tag"
|
|
|
|
|
SelectedValue="{Binding MapProjection, ElementName=map, Mode=TwoWay}">
|
|
|
|
|
<ComboBoxItem Content="Web Mercator" Tag="{StaticResource WebMercatorProjection}"/>
|
2017-10-27 17:15:18 +02:00
|
|
|
<ComboBoxItem Content="World Mercator" Tag="{StaticResource WorldMercatorProjection}"/>
|
2017-06-25 23:05:48 +02:00
|
|
|
<ComboBoxItem Content="Equirectangular" Tag="{StaticResource EquirectangularProjection}"/>
|
|
|
|
|
<ComboBoxItem Content="Orthographic" Tag="{StaticResource OrthographicProjection}"/>
|
|
|
|
|
<ComboBoxItem Content="Gnomonic" Tag="{StaticResource GnomonicProjection}"/>
|
|
|
|
|
<ComboBoxItem Content="Stereographic" Tag="{StaticResource StereographicProjection}"/>
|
2015-08-09 20:04:44 +02:00
|
|
|
</ComboBox>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Page>
|