mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-07 23:45:05 +00:00
Reworked sample applications
This commit is contained in:
parent
9ce981a6ee
commit
32491a8e31
22 changed files with 947 additions and 706 deletions
|
|
@ -2,24 +2,15 @@
|
|||
x:Class="SampleApplication.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:map="using:MapControl">
|
||||
xmlns:map="using:MapControl"
|
||||
xmlns:local="using:SampleApplication">
|
||||
|
||||
<Grid x:Name="root">
|
||||
<Grid>
|
||||
<Grid.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">
|
||||
<Setter Property="AutoCollapse" Value="True"/>
|
||||
<Setter Property="LocationMemberPath" Value="Location"/>
|
||||
|
|
@ -90,32 +81,22 @@
|
|||
|
||||
</Grid.Resources>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.DataContext>
|
||||
<local:MapViewModel/>
|
||||
</Grid.DataContext>
|
||||
|
||||
<map:Map x:Name="map" ZoomLevel="11" MaxZoomLevel="21" MouseWheelZoomDelta=".5"
|
||||
Center="{Binding MapCenter}"
|
||||
MapLayer="{Binding MapLayers.CurrentMapLayer}"
|
||||
ViewportChanged="MapViewportChanged">
|
||||
<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>
|
||||
<map:Location Latitude="53.5" Longitude="8.2"/>
|
||||
</map:Map.Center>
|
||||
|
||||
<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>
|
||||
|
||||
<map:MapGraticule x:Name="graticule" Opacity="0.6"
|
||||
Visibility="{Binding IsChecked, ElementName=graticuleCheckBox}"/>
|
||||
|
||||
<map:MapScale HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
|
||||
|
||||
<!-- 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}"
|
||||
|
|
@ -131,23 +112,30 @@
|
|||
</map:Pushpin>
|
||||
</map:Map>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border HorizontalAlignment="Right" VerticalAlignment="Bottom" Background="#AFFFFFFF">
|
||||
<TextBlock Margin="4,2" FontSize="10" local:HyperlinkText.InlinesSource="{Binding MapLayer.Description, ElementName=map}"/>
|
||||
</Border>
|
||||
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<CheckBox x:Name="graticuleCheckBox"
|
||||
VerticalAlignment="Center" Content="Graticule"/>
|
||||
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Top" Margin="6">
|
||||
<local:MapLayersMenuButton
|
||||
Margin="2" Padding="8" ToolTipService.ToolTip="Map Layers and Overlays"
|
||||
Map="{Binding ElementName=map}"
|
||||
MapLayers="{Binding MapLayers}"
|
||||
MapOverlays="{Binding MapOverlays}"/>
|
||||
|
||||
<CheckBox VerticalAlignment="Center" Content="Seamarks"
|
||||
Checked="SeamarksChecked" Unchecked="SeamarksUnchecked"/>
|
||||
<!--<local:MapProjectionsMenuButton
|
||||
Margin="2" Padding="8" ToolTipService.ToolTip="Map Projections"
|
||||
Map="{Binding ElementName=map}"
|
||||
MapProjections="{Binding MapProjections}"/>-->
|
||||
|
||||
<ComboBox Width="250" VerticalAlignment="Center" Margin="5"
|
||||
ItemsSource="{Binding MapLayers.MapLayerNames}"
|
||||
SelectedItem="{Binding MapLayers.CurrentMapLayerName, Mode=TwoWay}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<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>
|
||||
|
||||
<Border HorizontalAlignment="Center" VerticalAlignment="Top" Margin="4" Background="#AFFFFFFF">
|
||||
<TextBlock x:Name="mouseLocation" Margin="4,2" Visibility="Collapsed"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue