mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 14:08:32 +00:00
Version 1.2.0: Added classes MapShape, MapRectangle and MapImage.
This commit is contained in:
parent
ec27d16119
commit
9b218ef376
45 changed files with 846 additions and 565 deletions
BIN
SampleApps/WpfApplication/10_535_330.jpg
Normal file
BIN
SampleApps/WpfApplication/10_535_330.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7 KiB |
|
|
@ -155,6 +155,8 @@
|
|||
MouseLeftButtonDown="MapMouseLeftButtonDown" MouseRightButtonDown="MapMouseRightButtonDown"
|
||||
MouseMove="MapMouseMove" MouseLeave="MapMouseLeave"
|
||||
ManipulationInertiaStarting="MapManipulationInertiaStarting">
|
||||
<map:MapImage x:Name="mapImage" South="53.54031" North="53.74871" West="8.08594" East="8.43750"
|
||||
Source="10_535_330.jpg" Opacity=".5"/>
|
||||
<map:MapGraticule Opacity="0.6"/>
|
||||
<map:MapScale Margin="4" Opacity="0.8"/>
|
||||
|
||||
|
|
@ -196,17 +198,28 @@
|
|||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Name="mouseLocation" Margin="4" VerticalAlignment="Center"/>
|
||||
<TextBlock Name="mouseLocation" Margin="5" VerticalAlignment="Bottom" FontFamily="Consolas"/>
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Slider ToolTip="Zoom Level" Margin="4" Width="100" SmallChange="0.01"
|
||||
Minimum="{Binding MinZoomLevel, ElementName=map}"
|
||||
Maximum="{Binding MaxZoomLevel, ElementName=map}"
|
||||
Value="{Binding TargetZoomLevel, ElementName=map}"/>
|
||||
<Slider ToolTip="Heading" Margin="4" Width="100" Minimum="0" Maximum="360" SmallChange="5" LargeChange="45"
|
||||
Value="{Binding TargetHeading, ElementName=map}"/>
|
||||
<CheckBox ToolTip="Map Overlay" Margin="4" VerticalAlignment="Center" Content="Seamarks" Click="SeamarksClick"/>
|
||||
<ComboBox ToolTip="Main Tile Layer" Margin="4" DisplayMemberPath="SourceName" SelectedIndex="0"
|
||||
ItemsSource="{Binding Source={StaticResource TileLayersView}}"/>
|
||||
<StackPanel Margin="5">
|
||||
<TextBlock Text="Zoom Level" Margin="0,0,0,2" HorizontalAlignment="Center" Foreground="Gray" FontSize="10"/>
|
||||
<Slider ToolTip="Zoom Level" Width="100" VerticalAlignment="Center" SmallChange="0.01"
|
||||
Minimum="{Binding MinZoomLevel, ElementName=map}"
|
||||
Maximum="{Binding MaxZoomLevel, ElementName=map}"
|
||||
Value="{Binding TargetZoomLevel, ElementName=map}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="5">
|
||||
<TextBlock Text="Heading" Margin="0,0,0,2" HorizontalAlignment="Center" Foreground="Gray" FontSize="10"/>
|
||||
<Slider ToolTip="Heading" Width="100" VerticalAlignment="Center" SmallChange="5" LargeChange="45"
|
||||
Minimum="0" Maximum="360" Value="{Binding TargetHeading, ElementName=map}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="5">
|
||||
<TextBlock Text="Image Opacity" Margin="0,0,0,2" HorizontalAlignment="Center" Foreground="Gray" FontSize="10"/>
|
||||
<Slider ToolTip="Image Opacity" Width="100" VerticalAlignment="Center"
|
||||
Minimum="0" Maximum="1" Value="{Binding Opacity, ElementName=mapImage}"/>
|
||||
</StackPanel>
|
||||
<CheckBox ToolTip="Seamarks Overlay" Margin="7" VerticalAlignment="Bottom" Content="Seamarks" Click="SeamarksClick"/>
|
||||
<ComboBox ToolTip="Tile Layer" Margin="5" VerticalAlignment="Bottom" DisplayMemberPath="SourceName"
|
||||
SelectedIndex="0" ItemsSource="{Binding Source={StaticResource TileLayersView}}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
using MapControl;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
|
@ -33,7 +34,7 @@ namespace WpfApplication
|
|||
|
||||
InitializeComponent();
|
||||
|
||||
ICollection<object> polylines = (ICollection<object>)Resources["Polylines"];
|
||||
var polylines = (ICollection<object>)Resources["Polylines"];
|
||||
polylines.Add(
|
||||
new SamplePolyline
|
||||
{
|
||||
|
|
@ -45,7 +46,7 @@ namespace WpfApplication
|
|||
Locations = LocationCollection.Parse("53.5978,8.1212 53.6018,8.1494 53.5859,8.1554 53.5852,8.1531 53.5841,8.1539 53.5802,8.1392 53.5826,8.1309 53.5867,8.1317 53.5978,8.1212")
|
||||
});
|
||||
|
||||
ICollection<object> points = (ICollection<object>)Resources["Points"];
|
||||
var points = (ICollection<object>)Resources["Points"];
|
||||
points.Add(
|
||||
new SamplePoint
|
||||
{
|
||||
|
|
@ -84,7 +85,7 @@ namespace WpfApplication
|
|||
});
|
||||
points.Add(movingPoint);
|
||||
|
||||
ICollection<object> pushpins = (ICollection<object>)Resources["Pushpins"];
|
||||
var pushpins = (ICollection<object>)Resources["Pushpins"];
|
||||
pushpins.Add(
|
||||
new SamplePoint
|
||||
{
|
||||
|
|
@ -110,8 +111,7 @@ namespace WpfApplication
|
|||
Location = new Location(53.5207, 8.2323)
|
||||
});
|
||||
|
||||
DispatcherTimer timer = new DispatcherTimer();
|
||||
timer.Interval = TimeSpan.FromSeconds(0.1);
|
||||
var timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(0.1) };
|
||||
timer.Tick += MovePoint;
|
||||
timer.Start();
|
||||
}
|
||||
|
|
@ -151,7 +151,15 @@ namespace WpfApplication
|
|||
|
||||
private void MapMouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
mouseLocation.Text = map.ViewportPointToLocation(e.GetPosition(map)).ToString();
|
||||
var location = map.ViewportPointToLocation(e.GetPosition(map));
|
||||
var longitude = Location.NormalizeLongitude(location.Longitude);
|
||||
var latString = location.Latitude < 0 ?
|
||||
string.Format(CultureInfo.InvariantCulture, "S {0:00.00000}", -location.Latitude) :
|
||||
string.Format(CultureInfo.InvariantCulture, "N {0:00.00000}", location.Latitude);
|
||||
var lonString = longitude < 0 ?
|
||||
string.Format(CultureInfo.InvariantCulture, "W {0:000.00000}", -longitude) :
|
||||
string.Format(CultureInfo.InvariantCulture, "E {0:000.00000}", longitude);
|
||||
mouseLocation.Text = latString + "\n" + lonString;
|
||||
}
|
||||
|
||||
private void MapManipulationInertiaStarting(object sender, ManipulationInertiaStartingEventArgs e)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ using System.Windows;
|
|||
[assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: AssemblyVersion("1.1.10")]
|
||||
[assembly: AssemblyFileVersion("1.1.10")]
|
||||
[assembly: AssemblyVersion("1.2.0")]
|
||||
[assembly: AssemblyFileVersion("1.2.0")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
|
||||
|
|
|
|||
|
|
@ -96,6 +96,9 @@
|
|||
<Name>MapControl.WPF</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="10_535_330.jpg" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue