Reworked sample applications

This commit is contained in:
Clemens 2021-12-05 17:43:05 +01:00
parent 32491a8e31
commit fd7b53a37b
4 changed files with 8 additions and 12 deletions

View file

@ -5,10 +5,6 @@
xmlns:map="using:MapControl"
xmlns:local="using:SampleApplication">
<Page.DataContext>
<local:MapViewModel/>
</Page.DataContext>
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.Resources>
<DataTemplate x:Key="PolylineItemTemplate">
@ -84,6 +80,10 @@
</Style>
</Grid.Resources>
<Grid.DataContext>
<local:MapViewModel/>
</Grid.DataContext>
<map:Map x:Name="map"
MinZoomLevel="2" MaxZoomLevel="21" ZoomLevel="11" ManipulationMode="All"
MapLayer="{Binding MapLayers[OpenStreetMap]}"

View file

@ -88,7 +88,6 @@
<map:Map x:Name="map"
MinZoomLevel="2" MaxZoomLevel="21" ZoomLevel="11" MouseWheelZoomDelta="1"
MapLayer="{Binding MapLayers[OpenStreetMap]}"
ViewportChanged="MapViewportChanged"
PointerMoved="MapPointerMoved"
PointerExited="MapPointerExited">
<map:Map.Center>
@ -113,7 +112,8 @@
</map:Map>
<Border HorizontalAlignment="Right" VerticalAlignment="Bottom" Background="#AFFFFFFF">
<TextBlock Margin="4,2" FontSize="10" local:HyperlinkText.InlinesSource="{Binding MapLayer.Description, ElementName=map}"/>
<TextBlock Margin="4,2" FontSize="10"
local:HyperlinkText.InlinesSource="{Binding MapLayer.Description, ElementName=map}"/>
</Border>
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Top" Margin="6">

View file

@ -53,11 +53,6 @@ namespace SampleApplication
await ((ImageFileCache)TileImageLoader.Cache).Clean();
}
private void MapViewportChanged(object sender, ViewportChangedEventArgs e)
{
GC.Collect();
}
private void MapPointerMoved(object sender, PointerRoutedEventArgs e)
{
var location = map.ViewToLocation(e.GetCurrentPoint(map).Position);

View file

@ -104,7 +104,8 @@
<local:MapViewModel/>
</Grid.DataContext>
<map:Map x:Name="map" ZoomLevel="11" MaxZoomLevel="21" MouseWheelZoomDelta="1"
<map:Map x:Name="map"
MinZoomLevel="2" MaxZoomLevel="21" ZoomLevel="11" MouseWheelZoomDelta="1"
Center="53.5,8.2"
MapLayer="{Binding MapLayers[OpenStreetMap]}"
MouseLeftButtonDown="MapMouseLeftButtonDown"