Version 1.2.2: Added AnimateOpacity property to MapImage, TMS support to TileSource, Background and Foreground properties to TileLayer.

This commit is contained in:
ClemensF 2013-04-21 23:56:08 +02:00
parent 050f1acb38
commit c37149aafb
26 changed files with 229 additions and 129 deletions

View file

@ -9,6 +9,6 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.2.1")] [assembly: AssemblyVersion("1.2.2")]
[assembly: AssemblyFileVersion("1.2.1")] [assembly: AssemblyFileVersion("1.2.2")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -9,6 +9,6 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.2.1")] [assembly: AssemblyVersion("1.2.2")]
[assembly: AssemblyFileVersion("1.2.1")] [assembly: AssemblyFileVersion("1.2.2")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -4,6 +4,7 @@
#if NETFX_CORE #if NETFX_CORE
using Windows.Foundation; using Windows.Foundation;
using Windows.UI;
using Windows.UI.Xaml; using Windows.UI.Xaml;
using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Animation; using Windows.UI.Xaml.Media.Animation;

View file

@ -7,7 +7,6 @@ using System.Collections.Specialized;
using System.Linq; using System.Linq;
#if NETFX_CORE #if NETFX_CORE
using Windows.Foundation; using Windows.Foundation;
using Windows.UI;
using Windows.UI.Xaml; using Windows.UI.Xaml;
using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Animation; using Windows.UI.Xaml.Media.Animation;
@ -31,18 +30,6 @@ namespace MapControl
public static TimeSpan AnimationDuration = TimeSpan.FromSeconds(0.5); public static TimeSpan AnimationDuration = TimeSpan.FromSeconds(0.5);
public static EasingFunctionBase AnimationEasingFunction = new QuadraticEase { EasingMode = EasingMode.EaseOut }; public static EasingFunctionBase AnimationEasingFunction = new QuadraticEase { EasingMode = EasingMode.EaseOut };
public static readonly DependencyProperty LightForegroundProperty = DependencyProperty.Register(
"LightForeground", typeof(Brush), typeof(MapBase), null);
public static readonly DependencyProperty DarkForegroundProperty = DependencyProperty.Register(
"DarkForeground", typeof(Brush), typeof(MapBase), null);
public static readonly DependencyProperty LightBackgroundProperty = DependencyProperty.Register(
"LightBackground", typeof(Brush), typeof(MapBase), new PropertyMetadata(new SolidColorBrush(Colors.Transparent), null));
public static readonly DependencyProperty DarkBackgroundProperty = DependencyProperty.Register(
"DarkBackground", typeof(Brush), typeof(MapBase), new PropertyMetadata(new SolidColorBrush(Colors.Transparent), null));
public static readonly DependencyProperty TileLayersProperty = DependencyProperty.Register( public static readonly DependencyProperty TileLayersProperty = DependencyProperty.Register(
"TileLayers", typeof(TileLayerCollection), typeof(MapBase), new PropertyMetadata(null, "TileLayers", typeof(TileLayerCollection), typeof(MapBase), new PropertyMetadata(null,
(o, e) => ((MapBase)o).TileLayersPropertyChanged((TileLayerCollection)e.OldValue, (TileLayerCollection)e.NewValue))); (o, e) => ((MapBase)o).TileLayersPropertyChanged((TileLayerCollection)e.OldValue, (TileLayerCollection)e.NewValue)));
@ -104,13 +91,14 @@ namespace MapControl
private PointAnimation centerAnimation; private PointAnimation centerAnimation;
private DoubleAnimation zoomLevelAnimation; private DoubleAnimation zoomLevelAnimation;
private DoubleAnimation headingAnimation; private DoubleAnimation headingAnimation;
private Brush previousBackground;
private Brush previousForeground;
private bool internalPropertyChange; private bool internalPropertyChange;
public MapBase() public MapBase()
{ {
SetParentMap(); SetParentMap();
Background = LightBackground;
TileLayers = new TileLayerCollection(); TileLayers = new TileLayerCollection();
Initialize(); Initialize();
@ -133,46 +121,6 @@ namespace MapControl
set { SetValue(ForegroundProperty, value); } set { SetValue(ForegroundProperty, value); }
} }
/// <summary>
/// Gets or sets a Brush that (when not null) is used as value of the
/// Foreground property when TileLayer.HasDarkBackground is false.
/// </summary>
public Brush LightForeground
{
get { return (Brush)GetValue(LightForegroundProperty); }
set { SetValue(LightForegroundProperty, value); }
}
/// <summary>
/// Gets or sets a Brush that (when not null) is used as value of the
/// Foreground property when TileLayer.HasDarkBackground is true.
/// </summary>
public Brush DarkForeground
{
get { return (Brush)GetValue(DarkForegroundProperty); }
set { SetValue(DarkForegroundProperty, value); }
}
/// <summary>
/// Gets or sets a Brush that (when not null) is used as value of the
/// Background property when TileLayer.HasDarkBackground is false.
/// </summary>
public Brush LightBackground
{
get { return (Brush)GetValue(LightBackgroundProperty); }
set { SetValue(LightBackgroundProperty, value); }
}
/// <summary>
/// Gets or sets a Brush that (when not null) is used as value of the
/// Background property when TileLayer.HasDarkBackground is true.
/// </summary>
public Brush DarkBackground
{
get { return (Brush)GetValue(DarkBackgroundProperty); }
set { SetValue(DarkBackgroundProperty, value); }
}
/// <summary> /// <summary>
/// Gets or sets the TileLayers used by this Map. /// Gets or sets the TileLayers used by this Map.
/// </summary> /// </summary>
@ -536,29 +484,34 @@ namespace MapControl
} }
} }
if (tileLayer != null && tileLayer.HasDarkBackground) if (tileLayer != null && tileLayer.Background != null)
{ {
if (DarkForeground != null) if (previousBackground == null)
{ {
Foreground = DarkForeground; previousBackground = Background;
} }
if (DarkBackground != null) Background = tileLayer.Background;
{
Background = DarkBackground;
} }
} else if (previousBackground != null)
else
{ {
if (LightForeground != null) Background = previousBackground;
{ previousBackground = null;
Foreground = LightForeground;
} }
if (LightBackground != null) if (tileLayer != null && tileLayer.Foreground != null)
{ {
Background = LightBackground; if (previousForeground == null)
{
previousForeground = Foreground;
} }
Foreground = tileLayer.Foreground;
}
else if (previousForeground != null)
{
Foreground = previousForeground;
previousForeground = null;
} }
} }

View file

@ -76,6 +76,7 @@
<Compile Include="MapGraticule.cs" /> <Compile Include="MapGraticule.cs" />
<Compile Include="MapGraticule.Silverlight.WinRT.cs" /> <Compile Include="MapGraticule.Silverlight.WinRT.cs" />
<Compile Include="MapImage.cs" /> <Compile Include="MapImage.cs" />
<Compile Include="MapImage.Silverlight.WinRT.cs" />
<Compile Include="MapItem.Silverlight.WinRT.cs" /> <Compile Include="MapItem.Silverlight.WinRT.cs" />
<Compile Include="MapItemsControl.cs" /> <Compile Include="MapItemsControl.cs" />
<Compile Include="MapItemsControl.Silverlight.WinRT.cs" /> <Compile Include="MapItemsControl.Silverlight.WinRT.cs" />

View file

@ -56,6 +56,7 @@
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="MapBase.WPF.cs" /> <Compile Include="MapBase.WPF.cs" />
<Compile Include="MapImage.WPF.cs" />
<Compile Include="MapItem.WPF.cs" /> <Compile Include="MapItem.WPF.cs" />
<Compile Include="MapItemsControl.cs" /> <Compile Include="MapItemsControl.cs" />
<Compile Include="MapItemsControl.WPF.cs" /> <Compile Include="MapItemsControl.WPF.cs" />

View file

@ -0,0 +1,49 @@
// XAML Map Control - http://xamlmapcontrol.codeplex.com/
// Copyright © 2013 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
#if NETFX_CORE
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;
#else
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
#endif
namespace MapControl
{
public partial class MapImage
{
private void BeginOpacityAnimation(ImageSource image)
{
var bitmapImage = image as BitmapImage;
if (bitmapImage != null)
{
bitmapImage.ImageOpened += BitmapImageOpened;
bitmapImage.ImageFailed += BitmapImageFailed;
}
else
{
BeginOpacityAnimation();
}
}
private void BitmapImageOpened(object sender, RoutedEventArgs e)
{
((BitmapImage)sender).ImageOpened -= BitmapImageOpened;
((BitmapImage)sender).ImageFailed -= BitmapImageFailed;
BeginOpacityAnimation();
}
private void BitmapImageFailed(object sender, ExceptionRoutedEventArgs e)
{
((BitmapImage)sender).ImageOpened -= BitmapImageOpened;
((BitmapImage)sender).ImageFailed -= BitmapImageFailed;
((ImageBrush)Fill).ImageSource = null;
}
}
}

View file

@ -0,0 +1,42 @@
// XAML Map Control - http://xamlmapcontrol.codeplex.com/
// Copyright © 2013 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
using System;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace MapControl
{
public partial class MapImage
{
private void BeginOpacityAnimation(ImageSource image)
{
var bitmapImage = image as BitmapImage;
if (bitmapImage != null && bitmapImage.IsDownloading)
{
bitmapImage.DownloadCompleted += BitmapDownloadCompleted;
bitmapImage.DownloadFailed += BitmapDownloadFailed;
}
else
{
BeginOpacityAnimation();
}
}
private void BitmapDownloadCompleted(object sender, EventArgs e)
{
((BitmapImage)sender).DownloadCompleted -= BitmapDownloadCompleted;
((BitmapImage)sender).DownloadFailed -= BitmapDownloadFailed;
BeginOpacityAnimation();
}
private void BitmapDownloadFailed(object sender, ExceptionEventArgs e)
{
((BitmapImage)sender).DownloadCompleted -= BitmapDownloadCompleted;
((BitmapImage)sender).DownloadFailed -= BitmapDownloadFailed;
((ImageBrush)Fill).ImageSource = null;
}
}
}

View file

@ -5,14 +5,16 @@
#if NETFX_CORE #if NETFX_CORE
using Windows.UI.Xaml; using Windows.UI.Xaml;
using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Animation;
#else #else
using System.Windows; using System.Windows;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Animation;
#endif #endif
namespace MapControl namespace MapControl
{ {
public class MapImage : MapRectangle public partial class MapImage : MapRectangle
{ {
private static readonly Transform imageTransform = new MatrixTransform private static readonly Transform imageTransform = new MatrixTransform
{ {
@ -29,13 +31,36 @@ namespace MapControl
set { SetValue(SourceProperty, value); } set { SetValue(SourceProperty, value); }
} }
private void SourceChanged(ImageSource source) public bool AnimateOpacity { get; set; }
private void SourceChanged(ImageSource image)
{ {
Fill = new ImageBrush Fill = new ImageBrush
{ {
ImageSource = source, ImageSource = image,
RelativeTransform = imageTransform RelativeTransform = imageTransform,
Opacity = 0d
}; };
if (AnimateOpacity)
{
BeginOpacityAnimation(image);
}
else
{
Fill.Opacity = 1d;
}
}
private void BeginOpacityAnimation()
{
Fill.BeginAnimation(Brush.OpacityProperty,
new DoubleAnimation
{
To = 1d,
Duration = Tile.AnimationDuration,
FillBehavior = FillBehavior.HoldEnd
});
} }
} }
} }

View file

@ -16,6 +16,6 @@ using System.Windows;
[assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.2.1")] [assembly: AssemblyVersion("1.2.2")]
[assembly: AssemblyFileVersion("1.2.1")] [assembly: AssemblyFileVersion("1.2.2")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -6,11 +6,13 @@
using Windows.UI.Xaml; using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Animation;
using Windows.UI.Xaml.Media.Imaging; using Windows.UI.Xaml.Media.Imaging;
#else #else
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
#endif #endif
@ -18,7 +20,7 @@ namespace MapControl
{ {
public partial class Tile public partial class Tile
{ {
public readonly Image Image = new Image { IsHitTestVisible = false, Opacity = 0d }; public readonly Image Image = new Image { Opacity = 0d };
public ImageSource ImageSource public ImageSource ImageSource
{ {
@ -40,7 +42,7 @@ namespace MapControl
} }
else else
{ {
Image.BeginAnimation(Image.OpacityProperty, OpacityAnimation); BeginOpacityAnimation();
} }
} }
else else
@ -57,7 +59,7 @@ namespace MapControl
{ {
((BitmapImage)sender).ImageOpened -= BitmapImageOpened; ((BitmapImage)sender).ImageOpened -= BitmapImageOpened;
((BitmapImage)sender).ImageFailed -= BitmapImageFailed; ((BitmapImage)sender).ImageFailed -= BitmapImageFailed;
Image.BeginAnimation(Image.OpacityProperty, OpacityAnimation); BeginOpacityAnimation();
} }
private void BitmapImageFailed(object sender, ExceptionRoutedEventArgs e) private void BitmapImageFailed(object sender, ExceptionRoutedEventArgs e)
@ -66,5 +68,16 @@ namespace MapControl
((BitmapImage)sender).ImageFailed -= BitmapImageFailed; ((BitmapImage)sender).ImageFailed -= BitmapImageFailed;
Image.Source = null; Image.Source = null;
} }
private void BeginOpacityAnimation()
{
Image.BeginAnimation(Image.OpacityProperty,
new DoubleAnimation
{
To = 1d,
Duration = AnimationDuration,
FillBehavior = FillBehavior.HoldEnd
});
}
} }
} }

View file

@ -4,6 +4,7 @@
using System; using System;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Threading; using System.Windows.Threading;
@ -33,7 +34,7 @@ namespace MapControl
} }
else else
{ {
Brush.BeginAnimation(ImageBrush.OpacityProperty, OpacityAnimation); BeginOpacityAnimation();
} }
} }
else else
@ -50,7 +51,7 @@ namespace MapControl
{ {
((BitmapImage)sender).DownloadCompleted -= BitmapDownloadCompleted; ((BitmapImage)sender).DownloadCompleted -= BitmapDownloadCompleted;
((BitmapImage)sender).DownloadFailed -= BitmapDownloadFailed; ((BitmapImage)sender).DownloadFailed -= BitmapDownloadFailed;
Brush.BeginAnimation(ImageBrush.OpacityProperty, OpacityAnimation); BeginOpacityAnimation();
} }
private void BitmapDownloadFailed(object sender, ExceptionEventArgs e) private void BitmapDownloadFailed(object sender, ExceptionEventArgs e)
@ -59,5 +60,16 @@ namespace MapControl
((BitmapImage)sender).DownloadFailed -= BitmapDownloadFailed; ((BitmapImage)sender).DownloadFailed -= BitmapDownloadFailed;
Brush.ImageSource = null; Brush.ImageSource = null;
} }
private void BeginOpacityAnimation()
{
Brush.BeginAnimation(ImageBrush.OpacityProperty,
new DoubleAnimation
{
To = 1d,
Duration = AnimationDuration,
FillBehavior = FillBehavior.HoldEnd
});
}
} }
} }

View file

@ -3,11 +3,6 @@
// Licensed under the Microsoft Public License (Ms-PL) // Licensed under the Microsoft Public License (Ms-PL)
using System; using System;
#if NETFX_CORE
using Windows.UI.Xaml.Media.Animation;
#else
using System.Windows.Media.Animation;
#endif
namespace MapControl namespace MapControl
{ {
@ -36,18 +31,5 @@ namespace MapControl
return ((X % numTiles) + numTiles) % numTiles; return ((X % numTiles) + numTiles) % numTiles;
} }
} }
public DoubleAnimation OpacityAnimation
{
get
{
return new DoubleAnimation
{
To = 1d,
Duration = AnimationDuration,
FillBehavior = FillBehavior.HoldEnd,
};
}
}
} }
} }

View file

@ -64,7 +64,8 @@ namespace MapControl
public int MaxZoomLevel { get; set; } public int MaxZoomLevel { get; set; }
public int MaxParallelDownloads { get; set; } public int MaxParallelDownloads { get; set; }
public bool LoadLowerZoomLevels { get; set; } public bool LoadLowerZoomLevels { get; set; }
public bool HasDarkBackground { get; set; } public Brush Background { get; set; }
public Brush Foreground { get; set; }
public string Description public string Description
{ {
@ -122,9 +123,12 @@ namespace MapControl
{ {
var tileSize = 1 << (zoomLevel - z); var tileSize = 1 << (zoomLevel - z);
var x1 = grid.X / tileSize; var x1 = grid.X / tileSize;
var y1 = grid.Y / tileSize;
var x2 = (grid.X + grid.Width - 1) / tileSize; var x2 = (grid.X + grid.Width - 1) / tileSize;
var y1 = Math.Max(0, grid.Y / tileSize); var y2 = (grid.Y + grid.Height - 1) / tileSize;
var y2 = Math.Min((1 << z) - 1, (grid.Y + grid.Height - 1) / tileSize);
y1 = Math.Max(y1, 0);
y2 = Math.Min(y2, (1 << z) - 1);
for (var y = y1; y <= y2; y++) for (var y = y1; y <= y2; y++)
{ {

View file

@ -68,6 +68,10 @@ namespace MapControl
{ {
getUri = GetBoundingBoxUri; getUri = GetBoundingBoxUri;
} }
else if (uriFormat.Contains("{x}") && uriFormat.Contains("{v}") && uriFormat.Contains("{z}"))
{
getUri = GetTmsUri;
}
} }
} }
@ -117,6 +121,16 @@ namespace MapControl
Replace("{z}", zoomLevel.ToString())); Replace("{z}", zoomLevel.ToString()));
} }
private Uri GetTmsUri(int x, int y, int zoomLevel)
{
y = (1 << zoomLevel) - 1 - y;
return new Uri(UriFormat.
Replace("{x}", x.ToString()).
Replace("{v}", y.ToString()).
Replace("{z}", zoomLevel.ToString()));
}
private Uri GetQuadKeyUri(int x, int y, int zoomLevel) private Uri GetQuadKeyUri(int x, int y, int zoomLevel)
{ {
var key = new StringBuilder { Length = zoomLevel }; var key = new StringBuilder { Length = zoomLevel };

View file

@ -66,6 +66,9 @@
<Compile Include="..\MapImage.cs"> <Compile Include="..\MapImage.cs">
<Link>MapImage.cs</Link> <Link>MapImage.cs</Link>
</Compile> </Compile>
<Compile Include="..\MapImage.Silverlight.WinRT.cs">
<Link>MapImage.Silverlight.WinRT.cs</Link>
</Compile>
<Compile Include="..\MapItem.Silverlight.WinRT.cs"> <Compile Include="..\MapItem.Silverlight.WinRT.cs">
<Link>MapItem.Silverlight.WinRT.cs</Link> <Link>MapItem.Silverlight.WinRT.cs</Link>
</Compile> </Compile>

View file

@ -9,6 +9,6 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.2.1")] [assembly: AssemblyVersion("1.2.2")]
[assembly: AssemblyFileVersion("1.2.1")] [assembly: AssemblyFileVersion("1.2.2")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -9,6 +9,6 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.2.1")] [assembly: AssemblyVersion("1.2.2")]
[assembly: AssemblyFileVersion("1.2.1")] [assembly: AssemblyFileVersion("1.2.2")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -106,7 +106,7 @@
<map:Map x:Name="map" Center="53.5,8.2" MinZoomLevel="2" MaxZoomLevel="18" ZoomLevel="11" <map:Map x:Name="map" Center="53.5,8.2" MinZoomLevel="2" MaxZoomLevel="18" ZoomLevel="11"
MouseMove="MapMouseMove" MouseLeave="MapMouseLeave"> MouseMove="MapMouseMove" MouseLeave="MapMouseLeave">
<map:MapImage x:Name="mapImage" South="53.54031" North="53.74871" West="8.08594" East="8.43750" <map:MapImage x:Name="mapImage" South="53.54031" North="53.74871" West="8.08594" East="8.43750"
Source="10_535_330.jpg" Opacity=".5"/> Source="10_535_330.jpg" Opacity="0.5"/>
<map:MapGraticule Opacity="0.6"/> <map:MapGraticule Opacity="0.6"/>
<!-- use ItemTemplate or ItemContainerStyle alternatively --> <!-- use ItemTemplate or ItemContainerStyle alternatively -->
@ -138,7 +138,7 @@
<ColumnDefinition/> <ColumnDefinition/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Name="mouseLocation" Margin="4" VerticalAlignment="Bottom" FontFamily="Consolas"/> <TextBlock Name="mouseLocation" Margin="4" VerticalAlignment="Bottom" FontFamily="Segoe UI Mono"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right"> <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
<StackPanel Margin="5"> <StackPanel Margin="5">
<TextBlock Text="Zoom Level" Margin="0,0,0,2" HorizontalAlignment="Center" Foreground="Gray" FontSize="10"/> <TextBlock Text="Zoom Level" Margin="0,0,0,2" HorizontalAlignment="Center" Foreground="Gray" FontSize="10"/>

View file

@ -9,6 +9,6 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.2.1")] [assembly: AssemblyVersion("1.2.2")]
[assembly: AssemblyFileVersion("1.2.1")] [assembly: AssemblyFileVersion("1.2.2")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -108,7 +108,7 @@
<map:Location Latitude="53.5" Longitude="8.2"/> <map:Location Latitude="53.5" Longitude="8.2"/>
</map:MapBase.Center> </map:MapBase.Center>
<map:MapImage x:Name="mapImage" South="53.54031" North="53.74871" West="8.08594" East="8.43750" <map:MapImage x:Name="mapImage" South="53.54031" North="53.74871" West="8.08594" East="8.43750"
Source="10_535_330.jpg" Opacity=".5"/> Source="10_535_330.jpg" Opacity="0.5"/>
<map:MapGraticule Foreground="Black" Opacity="0.6"/> <map:MapGraticule Foreground="Black" Opacity="0.6"/>
<!-- use ItemTemplate or ItemContainerStyle alternatively --> <!-- use ItemTemplate or ItemContainerStyle alternatively -->

View file

@ -9,6 +9,6 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.2.1")] [assembly: AssemblyVersion("1.2.2")]
[assembly: AssemblyFileVersion("1.2.1")] [assembly: AssemblyFileVersion("1.2.2")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -6,7 +6,6 @@
Title="SurfaceApplication" WindowStyle="None" WindowState="Maximized"> Title="SurfaceApplication" WindowStyle="None" WindowState="Maximized">
<Grid> <Grid>
<m:Map Center="53.5,8.2" ZoomLevel="11" <m:Map Center="53.5,8.2" ZoomLevel="11"
LightForeground="Black" LightBackground="LightGray"
IsManipulationEnabled="True" TouchDown="MapTouchDown"> IsManipulationEnabled="True" TouchDown="MapTouchDown">
<m:MapGraticule Opacity="0.5" MinLineSpacing="200"/> <m:MapGraticule Opacity="0.5" MinLineSpacing="200"/>
</m:Map> </m:Map>

View file

@ -10,7 +10,7 @@ using System.Windows;
[assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.2.1")] [assembly: AssemblyVersion("1.2.2")]
[assembly: AssemblyFileVersion("1.2.1")] [assembly: AssemblyFileVersion("1.2.2")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]

View file

@ -23,14 +23,14 @@
<!--<map:TileLayer SourceName="Google Maps" Description="Google Maps - © {y} Google" <!--<map:TileLayer SourceName="Google Maps" Description="Google Maps - © {y} Google"
TileSource="http://mt{i}.google.com/vt/x={x}&amp;y={y}&amp;z={z}" MaxZoomLevel="20"/> TileSource="http://mt{i}.google.com/vt/x={x}&amp;y={y}&amp;z={z}" MaxZoomLevel="20"/>
<map:TileLayer SourceName="Google Images" Description="Google Maps - © {y} Google" <map:TileLayer SourceName="Google Images" Description="Google Maps - © {y} Google" Background="#FF3F3F3F" Foreground="White"
TileSource="http://khm{i}.google.com/kh/v=123&amp;x={x}&amp;y={y}&amp;z={z}" MaxZoomLevel="20" HasDarkBackground="True"/> TileSource="http://khm{i}.google.com/kh/v=123&amp;x={x}&amp;y={y}&amp;z={z}" MaxZoomLevel="20"/>
<map:TileLayer SourceName="Bing Maps" Description="Bing Maps - © {y} Microsoft Corporation" <map:TileLayer SourceName="Bing Maps" Description="Bing Maps - © {y} Microsoft Corporation"
TileSource="http://ecn.t{i}.tiles.virtualearth.net/tiles/r{q}.png?g=0&amp;stl=h" MaxZoomLevel="20"/> TileSource="http://ecn.t{i}.tiles.virtualearth.net/tiles/r{q}.png?g=0&amp;stl=h" MaxZoomLevel="20"/>
<map:TileLayer SourceName="Bing Images" Description="Bing Maps - © {y} Microsoft Corporation" <map:TileLayer SourceName="Bing Images" Description="Bing Maps - © {y} Microsoft Corporation" Background="#FF3F3F3F" Foreground="White"
TileSource="http://ecn.t{i}.tiles.virtualearth.net/tiles/a{q}.jpeg?g=0" MaxZoomLevel="20" HasDarkBackground="True"/> TileSource="http://ecn.t{i}.tiles.virtualearth.net/tiles/a{q}.jpeg?g=0" MaxZoomLevel="20"/>
<map:TileLayer SourceName="Bing Hybrid" Description="Bing Maps - © {y} Microsoft Corporation" <map:TileLayer SourceName="Bing Hybrid" Description="Bing Maps - © {y} Microsoft Corporation" Background="#FF3F3F3F" Foreground="White"
TileSource="http://ecn.t{i}.tiles.virtualearth.net/tiles/h{q}.jpeg?g=0&amp;stl=h" MaxZoomLevel="20" HasDarkBackground="True"/>--> TileSource="http://ecn.t{i}.tiles.virtualearth.net/tiles/h{q}.jpeg?g=0&amp;stl=h" MaxZoomLevel="20"/>-->
<!-- The TileLayer below uses an ImageTileSource, which bypasses caching of map tile images --> <!-- The TileLayer below uses an ImageTileSource, which bypasses caching of map tile images -->
<!--<map:TileLayer SourceName="OSM Uncached" Description="© {y} OpenStreetMap Contributors, CC-BY-SA"> <!--<map:TileLayer SourceName="OSM Uncached" Description="© {y} OpenStreetMap Contributors, CC-BY-SA">
@ -149,14 +149,15 @@
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<map:Map Name="map" IsManipulationEnabled="True" Margin="2" <map:Map Name="map" IsManipulationEnabled="True" Margin="2"
LightForeground="Black" LightBackground="White" DarkForeground="White" DarkBackground="#FF3F3F3F"
Center="53.5,8.2" ZoomLevel="11" MaxZoomLevel="20" Center="53.5,8.2" ZoomLevel="11" MaxZoomLevel="20"
TileLayer="{Binding Source={StaticResource TileLayersView}, Path=CurrentItem}" TileLayer="{Binding Source={StaticResource TileLayersView}, Path=CurrentItem}"
MouseLeftButtonDown="MapMouseLeftButtonDown" MouseRightButtonDown="MapMouseRightButtonDown" MouseLeftButtonDown="MapMouseLeftButtonDown" MouseRightButtonDown="MapMouseRightButtonDown"
MouseMove="MapMouseMove" MouseLeave="MapMouseLeave" MouseMove="MapMouseMove" MouseLeave="MapMouseLeave"
ManipulationInertiaStarting="MapManipulationInertiaStarting"> ManipulationInertiaStarting="MapManipulationInertiaStarting">
<map:MapImage x:Name="mapImage" South="53.54031" North="53.74871" West="8.08594" East="8.43750" <map:MapImage x:Name="mapImage" South="53.54031" North="53.74871" West="8.08594" East="8.43750"
Source="10_535_330.jpg" Opacity=".5"/> Source="10_535_330.jpg" Opacity="0.5"/>
<map:MapGraticule Opacity="0.6"/> <map:MapGraticule Opacity="0.6"/>
<map:MapScale Margin="4" Opacity="0.8"/> <map:MapScale Margin="4" Opacity="0.8"/>
@ -198,7 +199,7 @@
<ColumnDefinition/> <ColumnDefinition/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Name="mouseLocation" Margin="5" VerticalAlignment="Bottom" FontFamily="Consolas"/> <TextBlock Name="mouseLocation" Margin="5" VerticalAlignment="Bottom" FontFamily="Segoe UI Mono"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right"> <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
<StackPanel Margin="5"> <StackPanel Margin="5">
<TextBlock Text="Zoom Level" Margin="0,0,0,2" HorizontalAlignment="Center" Foreground="Gray" FontSize="10"/> <TextBlock Text="Zoom Level" Margin="0,0,0,2" HorizontalAlignment="Center" Foreground="Gray" FontSize="10"/>

View file

@ -10,7 +10,7 @@ using System.Windows;
[assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.2.1")] [assembly: AssemblyVersion("1.2.2")]
[assembly: AssemblyFileVersion("1.2.1")] [assembly: AssemblyFileVersion("1.2.2")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]