2015-08-09 20:04:44 +02:00
|
|
|
<Page
|
2021-10-28 20:26:51 +02:00
|
|
|
x:Class="SampleApplication.MainPage"
|
2015-08-09 20:04:44 +02:00
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
2021-12-05 17:16:14 +01:00
|
|
|
xmlns:map="using:MapControl"
|
|
|
|
|
xmlns:local="using:SampleApplication">
|
2015-08-09 20:04:44 +02:00
|
|
|
|
|
|
|
|
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
2021-12-05 17:16:14 +01:00
|
|
|
<Grid.Resources>
|
|
|
|
|
<DataTemplate x:Key="PolylineItemTemplate">
|
|
|
|
|
<map:MapPolyline Locations="{Binding Locations}" Stroke="Red" StrokeThickness="3"/>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
|
|
|
|
<Style x:Key="PointItemStyle" TargetType="map:MapItem">
|
|
|
|
|
<Setter Property="AutoCollapse" Value="True"/>
|
|
|
|
|
<Setter Property="LocationMemberPath" Value="Location"/>
|
|
|
|
|
<Setter Property="FontSize" Value="12"/>
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="map:MapItem">
|
|
|
|
|
<Canvas>
|
|
|
|
|
<VisualStateManager.VisualStateGroups>
|
|
|
|
|
<VisualStateGroup x:Name="CommonStates">
|
|
|
|
|
<VisualState x:Name="Normal"/>
|
|
|
|
|
<VisualState x:Name="Disabled"/>
|
|
|
|
|
<VisualState x:Name="PointerOver"/>
|
|
|
|
|
<VisualState x:Name="Pressed"/>
|
|
|
|
|
<VisualState x:Name="Selected">
|
|
|
|
|
<Storyboard>
|
|
|
|
|
<DoubleAnimation Storyboard.TargetName="selectedPath" Storyboard.TargetProperty="Opacity" To="0.75" Duration="0"/>
|
|
|
|
|
</Storyboard>
|
|
|
|
|
</VisualState>
|
|
|
|
|
<VisualState x:Name="SelectedUnfocused">
|
|
|
|
|
<Storyboard>
|
|
|
|
|
<DoubleAnimation Storyboard.TargetName="selectedPath" Storyboard.TargetProperty="Opacity" To="0.75" Duration="0"/>
|
|
|
|
|
</Storyboard>
|
|
|
|
|
</VisualState>
|
|
|
|
|
<VisualState x:Name="SelectedPointerOver">
|
|
|
|
|
<Storyboard>
|
|
|
|
|
<DoubleAnimation Storyboard.TargetName="selectedPath" Storyboard.TargetProperty="Opacity" To="0.75" Duration="0"/>
|
|
|
|
|
</Storyboard>
|
|
|
|
|
</VisualState>
|
|
|
|
|
<VisualState x:Name="SelectedPressed">
|
|
|
|
|
<Storyboard>
|
|
|
|
|
<DoubleAnimation Storyboard.TargetName="selectedPath" Storyboard.TargetProperty="Opacity" To="0.75" Duration="0"/>
|
|
|
|
|
</Storyboard>
|
|
|
|
|
</VisualState>
|
|
|
|
|
</VisualStateGroup>
|
|
|
|
|
</VisualStateManager.VisualStateGroups>
|
|
|
|
|
<Path x:Name="selectedPath" Fill="White" Opacity="0">
|
|
|
|
|
<Path.Data>
|
|
|
|
|
<EllipseGeometry RadiusX="12" RadiusY="12"/>
|
|
|
|
|
</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">
|
|
|
|
|
<TextBlock Margin="2,0,2,0" Text="{Binding Name}"/>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Canvas>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
<Style x:Key="PushpinItemStyle" TargetType="map:MapItem">
|
|
|
|
|
<Setter Property="AutoCollapse" Value="True"/>
|
|
|
|
|
<Setter Property="LocationMemberPath" Value="Location"/>
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Bottom"/>
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="map:MapItem">
|
|
|
|
|
<map:Pushpin Content="{Binding Name}"/>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
</Grid.Resources>
|
|
|
|
|
|
2021-12-05 17:43:05 +01:00
|
|
|
<Grid.DataContext>
|
|
|
|
|
<local:MapViewModel/>
|
|
|
|
|
</Grid.DataContext>
|
|
|
|
|
|
2021-12-05 17:16:14 +01:00
|
|
|
<map:Map x:Name="map"
|
|
|
|
|
MinZoomLevel="2" MaxZoomLevel="21" ZoomLevel="11" ManipulationMode="All"
|
|
|
|
|
MapLayer="{Binding MapLayers[OpenStreetMap]}"
|
|
|
|
|
PointerMoved="MapPointerMoved"
|
|
|
|
|
PointerExited="MapPointerExited">
|
|
|
|
|
<map:Map.Center>
|
|
|
|
|
<map:Location Latitude="53.5" Longitude="8.2"/>
|
|
|
|
|
</map:Map.Center>
|
2015-08-09 20:04:44 +02:00
|
|
|
|
|
|
|
|
<map:MapItemsControl ItemsSource="{Binding Polylines}"
|
|
|
|
|
ItemTemplate="{StaticResource PolylineItemTemplate}"/>
|
|
|
|
|
|
|
|
|
|
<map:MapItemsControl ItemsSource="{Binding Points}"
|
|
|
|
|
ItemContainerStyle="{StaticResource PointItemStyle}"
|
|
|
|
|
SelectionMode="Extended"/>
|
|
|
|
|
|
|
|
|
|
<map:MapItemsControl ItemsSource="{Binding Pushpins}"
|
|
|
|
|
ItemContainerStyle="{StaticResource PushpinItemStyle}"/>
|
|
|
|
|
|
2021-07-18 13:33:11 +02:00
|
|
|
<map:Pushpin AutoCollapse="True" Content="N 53°30' E 8°12'">
|
2021-01-12 22:20:32 +01:00
|
|
|
<map:Pushpin.Location>
|
2015-08-09 20:04:44 +02:00
|
|
|
<map:Location Latitude="53.5" Longitude="8.2"/>
|
2021-01-12 22:20:32 +01:00
|
|
|
</map:Pushpin.Location>
|
2015-08-09 20:04:44 +02:00
|
|
|
</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">
|
2021-01-17 21:39:42 +01:00
|
|
|
<TextBlock Margin="2" FontSize="10"
|
2021-12-05 17:16:14 +01:00
|
|
|
local:HyperlinkText.InlinesSource="{Binding MapLayer.Description, ElementName=map}"/>
|
2015-08-09 20:04:44 +02:00
|
|
|
</Border>
|
2016-04-19 19:36:03 +02:00
|
|
|
|
2021-12-05 17:16:14 +01:00
|
|
|
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Top" Margin="6" Background="#7FFFFFFF">
|
|
|
|
|
<local:MapLayersMenuButton
|
|
|
|
|
Margin="2" Padding="8" ToolTipService.ToolTip="Map Layers"
|
|
|
|
|
Map="{Binding ElementName=map}"
|
|
|
|
|
MapLayers="{Binding MapLayers}"
|
|
|
|
|
MapOverlays="{Binding MapOverlays}"/>
|
|
|
|
|
|
|
|
|
|
<!--<local:MapProjectionsMenuButton
|
|
|
|
|
Margin="2" Padding="8" ToolTipService.ToolTip="Map Projections"
|
|
|
|
|
Map="{Binding ElementName=map}"
|
|
|
|
|
MapProjections="{Binding MapProjections}"/>-->
|
|
|
|
|
|
|
|
|
|
<Slider Orientation="Vertical" Margin="4,8" Height="100"
|
|
|
|
|
Minimum="{Binding MinZoomLevel, ElementName=map}"
|
|
|
|
|
Maximum="{Binding MaxZoomLevel, ElementName=map}"
|
|
|
|
|
Value="{Binding TargetZoomLevel, ElementName=map, Mode=TwoWay}"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
2021-12-05 18:30:58 +01:00
|
|
|
<Border HorizontalAlignment="Center" VerticalAlignment="Top" Margin="4"
|
|
|
|
|
Background="#AFFFFFFF" IsHitTestVisible="False">
|
2021-12-05 17:16:14 +01:00
|
|
|
<TextBlock x:Name="mouseLocation" Margin="4,2" Visibility="Collapsed"/>
|
|
|
|
|
</Border>
|
2015-08-09 20:04:44 +02:00
|
|
|
</Grid>
|
|
|
|
|
</Page>
|