2021-12-06 17:54:46 +01:00
|
|
|
<Page x:Class="SampleApplication.MainPage"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:map="using:MapControl"
|
2022-01-11 19:42:12 +01:00
|
|
|
xmlns:tools="using:MapControl.UiTools"
|
2021-12-06 17:54:46 +01:00
|
|
|
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="FontSize" Value="12"/>
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="map:MapItem">
|
2023-01-21 14:41:03 +01:00
|
|
|
<map:CanvasPanel>
|
2021-12-05 17:16:14 +01:00
|
|
|
<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>
|
2022-11-06 15:27:39 +01:00
|
|
|
<DoubleAnimation Storyboard.TargetName="selectedPath"
|
|
|
|
|
Storyboard.TargetProperty="Opacity"
|
|
|
|
|
To="0.75" Duration="0"/>
|
2021-12-05 17:16:14 +01:00
|
|
|
</Storyboard>
|
|
|
|
|
</VisualState>
|
|
|
|
|
<VisualState x:Name="SelectedUnfocused">
|
|
|
|
|
<Storyboard>
|
2022-11-06 15:27:39 +01:00
|
|
|
<DoubleAnimation Storyboard.TargetName="selectedPath"
|
|
|
|
|
Storyboard.TargetProperty="Opacity"
|
|
|
|
|
To="0.75" Duration="0"/>
|
2021-12-05 17:16:14 +01:00
|
|
|
</Storyboard>
|
|
|
|
|
</VisualState>
|
|
|
|
|
<VisualState x:Name="SelectedPointerOver">
|
|
|
|
|
<Storyboard>
|
2022-11-06 15:27:39 +01:00
|
|
|
<DoubleAnimation Storyboard.TargetName="selectedPath"
|
|
|
|
|
Storyboard.TargetProperty="Opacity"
|
|
|
|
|
To="0.75" Duration="0"/>
|
2021-12-05 17:16:14 +01:00
|
|
|
</Storyboard>
|
|
|
|
|
</VisualState>
|
|
|
|
|
<VisualState x:Name="SelectedPressed">
|
|
|
|
|
<Storyboard>
|
2022-11-06 15:27:39 +01:00
|
|
|
<DoubleAnimation Storyboard.TargetName="selectedPath"
|
|
|
|
|
Storyboard.TargetProperty="Opacity"
|
|
|
|
|
To="0.75" Duration="0"/>
|
2021-12-05 17:16:14 +01:00
|
|
|
</Storyboard>
|
|
|
|
|
</VisualState>
|
|
|
|
|
</VisualStateGroup>
|
|
|
|
|
</VisualStateManager.VisualStateGroups>
|
2023-01-21 14:41:03 +01:00
|
|
|
<!-- Path with transformed Geometry -->
|
2022-11-06 15:27:39 +01:00
|
|
|
<Path Fill="Red" Opacity="0.4" IsHitTestVisible="False">
|
|
|
|
|
<Path.Data>
|
|
|
|
|
<EllipseGeometry RadiusX="20" RadiusY="20"
|
|
|
|
|
Transform="{Binding MapTransform, RelativeSource={RelativeSource TemplatedParent}}"/>
|
|
|
|
|
</Path.Data>
|
|
|
|
|
</Path>
|
2023-01-21 14:41:03 +01:00
|
|
|
<!-- MapPath with Location, requires CanvasPanel parent to avoid clipping -->
|
|
|
|
|
<map:MapPath Stroke="Green" StrokeThickness="2" IsHitTestVisible="False"
|
|
|
|
|
Location="{TemplateBinding Location}">
|
|
|
|
|
<map:MapPath.Data>
|
|
|
|
|
<EllipseGeometry RadiusX="20" RadiusY="20"/>
|
|
|
|
|
</map:MapPath.Data>
|
|
|
|
|
</map:MapPath>
|
2021-12-05 17:16:14 +01:00
|
|
|
<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>
|
2023-01-21 14:41:03 +01:00
|
|
|
</map:CanvasPanel>
|
2021-12-05 17:16:14 +01:00
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
<Style x:Key="PushpinItemStyle" TargetType="map:MapItem">
|
|
|
|
|
<Setter Property="AutoCollapse" Value="True"/>
|
2022-02-05 15:52:17 +01:00
|
|
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
2021-12-05 17:16:14 +01:00
|
|
|
<Setter Property="VerticalAlignment" Value="Bottom"/>
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="map:MapItem">
|
2022-02-05 15:52:17 +01:00
|
|
|
<map:Pushpin Content="{Binding Name}"
|
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"/>
|
2021-12-05 17:16:14 +01:00
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
</Grid.Resources>
|
|
|
|
|
|
2021-12-05 17:43:05 +01:00
|
|
|
<Grid.DataContext>
|
|
|
|
|
<local:MapViewModel/>
|
|
|
|
|
</Grid.DataContext>
|
|
|
|
|
|
2021-12-06 17:54:46 +01:00
|
|
|
<map:Map x:Name="map" ManipulationMode="All"
|
|
|
|
|
MinZoomLevel="2" MaxZoomLevel="21" ZoomLevel="11"
|
2023-01-06 16:01:03 +01:00
|
|
|
PointerPressed="MapPointerPressed"
|
|
|
|
|
PointerReleased="MapPointerReleased"
|
2021-12-05 17:16:14 +01:00
|
|
|
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
|
|
|
|
2023-01-06 16:01:03 +01:00
|
|
|
<map:MapPolyline x:Name="measurementLine" Visibility="Collapsed"
|
|
|
|
|
Stroke="{Binding Foreground, ElementName=map}"
|
|
|
|
|
StrokeThickness="2" StrokeDashArray="1,1"/>
|
|
|
|
|
|
2015-08-09 20:04:44 +02:00
|
|
|
<map:MapItemsControl ItemsSource="{Binding Polylines}"
|
|
|
|
|
ItemTemplate="{StaticResource PolylineItemTemplate}"/>
|
|
|
|
|
|
|
|
|
|
<map:MapItemsControl ItemsSource="{Binding Points}"
|
|
|
|
|
ItemContainerStyle="{StaticResource PointItemStyle}"
|
2022-11-03 21:16:46 +01:00
|
|
|
LocationMemberPath="Location"
|
2015-08-09 20:04:44 +02:00
|
|
|
SelectionMode="Extended"/>
|
|
|
|
|
|
|
|
|
|
<map:MapItemsControl ItemsSource="{Binding Pushpins}"
|
2022-11-03 21:16:46 +01:00
|
|
|
ItemContainerStyle="{StaticResource PushpinItemStyle}"
|
|
|
|
|
LocationMemberPath="Location"/>
|
2015-08-09 20:04:44 +02:00
|
|
|
|
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
|
|
|
|
2023-01-05 15:50:42 +01:00
|
|
|
<Border HorizontalAlignment="Center" VerticalAlignment="Top" Margin="4" IsHitTestVisible="False">
|
|
|
|
|
<Border.Background>
|
|
|
|
|
<SolidColorBrush Color="{Binding Background.Color, ElementName=map}" Opacity="0.5"/>
|
|
|
|
|
</Border.Background>
|
|
|
|
|
<TextBlock x:Name="mouseLocation" Foreground="{Binding Foreground, ElementName=map}"
|
|
|
|
|
FontFamily="Consolas" Margin="4,2" Visibility="Collapsed"/>
|
2022-08-06 15:06:10 +02:00
|
|
|
</Border>
|
|
|
|
|
|
2022-08-05 22:56:00 +02:00
|
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" Background="#AFFFFFFF"
|
|
|
|
|
DataContext="{Binding MapLayer, ElementName=map}">
|
2022-08-06 15:06:10 +02:00
|
|
|
<ProgressBar Width="100" Height="8" Margin="4,2" VerticalAlignment="Center"
|
|
|
|
|
Maximum="1" Value="{Binding LoadingProgress}">
|
2022-08-05 21:30:57 +02:00
|
|
|
<ProgressBar.IsIndeterminate>
|
|
|
|
|
<Binding Path="Value" RelativeSource="{RelativeSource Self}">
|
|
|
|
|
<Binding.Converter>
|
|
|
|
|
<local:DoubleTriggerConverter Trigger="0" TriggerValue="true" DefaultValue="false"/>
|
|
|
|
|
</Binding.Converter>
|
|
|
|
|
</Binding>
|
|
|
|
|
</ProgressBar.IsIndeterminate>
|
|
|
|
|
<ProgressBar.Visibility>
|
|
|
|
|
<Binding Path="Value" RelativeSource="{RelativeSource Self}">
|
|
|
|
|
<Binding.Converter>
|
|
|
|
|
<local:DoubleTriggerConverter Trigger="1" TriggerValue="Collapsed" DefaultValue="Visible"/>
|
|
|
|
|
</Binding.Converter>
|
|
|
|
|
</Binding>
|
|
|
|
|
</ProgressBar.Visibility>
|
|
|
|
|
</ProgressBar>
|
|
|
|
|
|
2022-08-05 22:56:00 +02:00
|
|
|
<TextBlock Margin="4,2" FontSize="10" local:HyperlinkText.InlinesSource="{Binding Description}"/>
|
2022-08-05 21:30:57 +02:00
|
|
|
</StackPanel>
|
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">
|
2022-01-13 20:12:49 +01:00
|
|
|
<tools:MapLayersMenuButton x:Name="mapLayersMenuButton"
|
|
|
|
|
Margin="2" Padding="8" ToolTipService.ToolTip="Map Layers and Overlays"
|
|
|
|
|
Map="{Binding ElementName=map}">
|
|
|
|
|
<tools:MapLayerItem Text="OpenStreetMap">
|
|
|
|
|
<map:MapTileLayer
|
|
|
|
|
SourceName="OpenStreetMap"
|
|
|
|
|
Description="© [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)">
|
|
|
|
|
<map:MapTileLayer.TileSource>
|
2022-08-23 17:20:16 +02:00
|
|
|
<map:TileSource UriTemplate="https://tile.openstreetmap.org/{z}/{x}/{y}.png"/>
|
2022-01-13 20:12:49 +01:00
|
|
|
</map:MapTileLayer.TileSource>
|
|
|
|
|
</map:MapTileLayer>
|
|
|
|
|
</tools:MapLayerItem>
|
|
|
|
|
<tools:MapLayerItem Text="OpenStreetMap German">
|
|
|
|
|
<map:MapTileLayer
|
|
|
|
|
SourceName="OpenStreetMap German"
|
|
|
|
|
Description="© [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)">
|
|
|
|
|
<map:MapTileLayer.TileSource>
|
2022-08-23 17:20:16 +02:00
|
|
|
<map:TileSource UriTemplate="https://{s}.tile.openstreetmap.de/{z}/{x}/{y}.png"/>
|
2022-01-13 20:12:49 +01:00
|
|
|
</map:MapTileLayer.TileSource>
|
|
|
|
|
</map:MapTileLayer>
|
|
|
|
|
</tools:MapLayerItem>
|
|
|
|
|
<tools:MapLayerItem Text="OpenStreetMap French">
|
|
|
|
|
<map:MapTileLayer
|
|
|
|
|
SourceName="OpenStreetMap French"
|
|
|
|
|
Description="© [OpenStreetMap France](https://www.openstreetmap.fr/mentions-legales/) © [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)">
|
|
|
|
|
<map:MapTileLayer.TileSource>
|
2022-08-23 17:20:16 +02:00
|
|
|
<map:TileSource UriTemplate="http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png"/>
|
2022-01-13 20:12:49 +01:00
|
|
|
</map:MapTileLayer.TileSource>
|
|
|
|
|
</map:MapTileLayer>
|
|
|
|
|
</tools:MapLayerItem>
|
|
|
|
|
<tools:MapLayerItem Text="OpenTopoMap">
|
|
|
|
|
<map:MapTileLayer
|
|
|
|
|
SourceName="OpenTopoMap"
|
|
|
|
|
Description="© [OpenTopoMap](https://opentopomap.org/) © [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)">
|
|
|
|
|
<map:MapTileLayer.TileSource>
|
2022-08-23 17:20:16 +02:00
|
|
|
<map:TileSource UriTemplate="https://tile.opentopomap.org/{z}/{x}/{y}.png"/>
|
2022-01-13 20:12:49 +01:00
|
|
|
</map:MapTileLayer.TileSource>
|
|
|
|
|
</map:MapTileLayer>
|
|
|
|
|
</tools:MapLayerItem>
|
|
|
|
|
<tools:MapLayerItem Text="TopPlusOpen WMTS">
|
|
|
|
|
<map:WmtsTileLayer
|
|
|
|
|
SourceName="TopPlusOpen"
|
|
|
|
|
Description="© [BKG](https://gdz.bkg.bund.de/index.php/default/webdienste/topplus-produkte/wmts-topplusopen-wmts-topplus-open.html)"
|
|
|
|
|
CapabilitiesUri="https://sgx.geodatenzentrum.de/wmts_topplus_open/1.0.0/WMTSCapabilities.xml"/>
|
|
|
|
|
</tools:MapLayerItem>
|
|
|
|
|
<tools:MapLayerItem Text="TopPlusOpen WMS">
|
|
|
|
|
<map:WmsImageLayer
|
|
|
|
|
Description="© [BKG](https://gdz.bkg.bund.de/index.php/default/webdienste/topplus-produkte/wms-topplusopen-mit-layer-fur-normalausgabe-und-druck-wms-topplus-open.html)"
|
|
|
|
|
ServiceUri="https://sgx.geodatenzentrum.de/wms_topplus_open"/>
|
|
|
|
|
</tools:MapLayerItem>
|
|
|
|
|
<tools:MapLayerItem Text="OpenStreetMap WMS">
|
|
|
|
|
<map:WmsImageLayer
|
|
|
|
|
Description="© [terrestris GmbH & Co. KG](http://ows.terrestris.de/) © [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)"
|
|
|
|
|
ServiceUri="http://ows.terrestris.de/osm/service"/>
|
|
|
|
|
</tools:MapLayerItem>
|
|
|
|
|
<tools:MapLayersMenuButton.MapOverlays>
|
2022-12-14 18:02:19 +01:00
|
|
|
<tools:MapLayerItem Text="Graticule">
|
|
|
|
|
<map:MapGraticule Opacity="0.7"/>
|
2022-02-19 18:51:15 +01:00
|
|
|
</tools:MapLayerItem>
|
2022-12-14 18:02:19 +01:00
|
|
|
<tools:MapLayerItem Text="Scale">
|
|
|
|
|
<map:MapScale HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
|
2022-12-05 23:34:30 +01:00
|
|
|
</tools:MapLayerItem>
|
2022-01-13 20:12:49 +01:00
|
|
|
<tools:MapLayerItem Text="Seamarks">
|
|
|
|
|
<map:MapTileLayer SourceName="Seamarks" MinZoomLevel="9" MaxZoomLevel="18">
|
|
|
|
|
<map:MapTileLayer.TileSource>
|
2022-08-23 17:20:16 +02:00
|
|
|
<map:TileSource UriTemplate="http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png"/>
|
2022-01-13 20:12:49 +01:00
|
|
|
</map:MapTileLayer.TileSource>
|
|
|
|
|
</map:MapTileLayer>
|
|
|
|
|
</tools:MapLayerItem>
|
2022-12-14 18:02:19 +01:00
|
|
|
<tools:MapLayerItem Text="Sample Image">
|
|
|
|
|
<Image Source="10_535_330.jpg" Stretch="Fill">
|
|
|
|
|
<map:MapPanel.BoundingBox>
|
|
|
|
|
<map:BoundingBox South="53.54031" West="8.08594" North="53.74871" East="8.43750"/>
|
|
|
|
|
</map:MapPanel.BoundingBox>
|
|
|
|
|
</Image>
|
2022-01-13 20:12:49 +01:00
|
|
|
</tools:MapLayerItem>
|
2022-12-14 18:02:19 +01:00
|
|
|
<tools:MapLayerItem Text="Mount Etna KML">
|
|
|
|
|
<map:GroundOverlay SourcePath="etna.kml"/>
|
|
|
|
|
</tools:MapLayerItem>
|
2022-01-13 20:12:49 +01:00
|
|
|
</tools:MapLayersMenuButton.MapOverlays>
|
|
|
|
|
</tools:MapLayersMenuButton>
|
2021-12-05 17:16:14 +01:00
|
|
|
|
2022-01-11 19:42:12 +01:00
|
|
|
<tools:MapProjectionsMenuButton
|
2022-02-22 22:12:15 +01:00
|
|
|
x:Name="mapProjectionsMenuButton"
|
2021-12-05 17:16:14 +01:00
|
|
|
Margin="2" Padding="8" ToolTipService.ToolTip="Map Projections"
|
2022-01-13 20:12:49 +01:00
|
|
|
Map="{Binding ElementName=map}">
|
2022-01-19 23:42:45 +01:00
|
|
|
<tools:MapProjectionItem Text="Web Mercator" Projection="EPSG:3857"/>
|
|
|
|
|
<tools:MapProjectionItem Text="Equirectangular" Projection="EPSG:4326"/>
|
2022-12-14 18:02:19 +01:00
|
|
|
<tools:MapProjectionItem Text="ETRS89 / UTM zone 32N" Projection="EPSG:25832"/>
|
|
|
|
|
<tools:MapProjectionItem Text="WGS84 / Auto UTM" Projection="AUTO2:42001"/>
|
2022-01-13 20:12:49 +01:00
|
|
|
</tools:MapProjectionsMenuButton>
|
2021-12-05 17:16:14 +01:00
|
|
|
|
|
|
|
|
<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}"/>
|
2021-12-06 17:54:46 +01:00
|
|
|
|
2022-08-05 21:30:57 +02:00
|
|
|
<Button Margin="2" Padding="8" ToolTipService.ToolTip="Reset Heading" Click="ResetHeadingButtonClick">
|
|
|
|
|
<Button.Visibility>
|
|
|
|
|
<Binding Path="Heading" ElementName="map">
|
|
|
|
|
<Binding.Converter>
|
|
|
|
|
<local:DoubleTriggerConverter Trigger="0" TriggerValue="Collapsed" DefaultValue="Visible"/>
|
|
|
|
|
</Binding.Converter>
|
|
|
|
|
</Binding>
|
|
|
|
|
</Button.Visibility>
|
2022-01-24 23:07:36 +01:00
|
|
|
<FontIcon Glyph=""/>
|
2021-12-06 17:54:46 +01:00
|
|
|
</Button>
|
2021-12-05 17:16:14 +01:00
|
|
|
</StackPanel>
|
2015-08-09 20:04:44 +02:00
|
|
|
</Grid>
|
|
|
|
|
</Page>
|