diff --git a/Caching/FileDbCache/Properties/AssemblyInfo.cs b/Caching/FileDbCache/Properties/AssemblyInfo.cs
index 43e8ef2f..8f4ca7e0 100644
--- a/Caching/FileDbCache/Properties/AssemblyInfo.cs
+++ b/Caching/FileDbCache/Properties/AssemblyInfo.cs
@@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")]
[assembly: AssemblyTrademark("")]
-[assembly: AssemblyVersion("2.3.0")]
-[assembly: AssemblyFileVersion("2.3.0")]
+[assembly: AssemblyVersion("2.3.1")]
+[assembly: AssemblyFileVersion("2.3.1")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
diff --git a/Caching/ImageFileCache/Properties/AssemblyInfo.cs b/Caching/ImageFileCache/Properties/AssemblyInfo.cs
index 9dfb11fa..313744d6 100644
--- a/Caching/ImageFileCache/Properties/AssemblyInfo.cs
+++ b/Caching/ImageFileCache/Properties/AssemblyInfo.cs
@@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")]
[assembly: AssemblyTrademark("")]
-[assembly: AssemblyVersion("2.3.0")]
-[assembly: AssemblyFileVersion("2.3.0")]
+[assembly: AssemblyVersion("2.3.1")]
+[assembly: AssemblyFileVersion("2.3.1")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
diff --git a/MapControl/MapBase.cs b/MapControl/MapBase.cs
index 18a4b744..e5f129ff 100644
--- a/MapControl/MapBase.cs
+++ b/MapControl/MapBase.cs
@@ -782,12 +782,12 @@ namespace MapControl
private void UpdateTransform(bool resetTransformOrigin = false)
{
- var center = Center;
-
- SetViewportTransform(transformOrigin ?? center);
+ Location center;
if (transformOrigin != null)
{
+ SetViewportTransform(transformOrigin);
+
center = ViewportPointToLocation(new Point(RenderSize.Width / 2d, RenderSize.Height / 2d));
center.Longitude = Location.NormalizeLongitude(center.Longitude);
@@ -811,6 +811,11 @@ namespace MapControl
SetViewportTransform(center);
}
}
+ else
+ {
+ center = Center;
+ SetViewportTransform(center);
+ }
CenterScale = ViewportScale * mapTransform.RelativeScale(center) / TileSource.MetersPerDegree; // Pixels per meter at center latitude
@@ -820,7 +825,7 @@ namespace MapControl
private void SetViewportTransform(Location origin)
{
- ViewportScale = tileContainer.SetViewportTransform(ZoomLevel, Heading, mapTransform.Transform(origin), viewportOrigin, RenderSize);
+ ViewportScale = tileContainer.SetViewportTransform(ZoomLevel, Heading, mapTransform.Transform(origin), viewportOrigin);
}
}
}
diff --git a/MapControl/MapControl.PhoneSilverlight.csproj b/MapControl/MapControl.PhoneSilverlight.csproj
index d914da3a..a2455929 100644
--- a/MapControl/MapControl.PhoneSilverlight.csproj
+++ b/MapControl/MapControl.PhoneSilverlight.csproj
@@ -40,48 +40,6 @@
prompt
4
-
- true
- full
- false
- Bin\x86\Debug
- DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE
- true
- true
- prompt
- 4
-
-
- pdbonly
- true
- Bin\x86\Release
- TRACE;SILVERLIGHT;WINDOWS_PHONE
- true
- true
- prompt
- 4
-
-
- true
- full
- false
- Bin\ARM\Debug
- DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE
- true
- true
- prompt
- 4
-
-
- pdbonly
- true
- Bin\ARM\Release
- TRACE;SILVERLIGHT;WINDOWS_PHONE
- true
- true
- prompt
- 4
-
diff --git a/MapControl/MapControl.PhoneSilverlight.csproj.user b/MapControl/MapControl.PhoneSilverlight.csproj.user
deleted file mode 100644
index d3122c8a..00000000
--- a/MapControl/MapControl.PhoneSilverlight.csproj.user
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
- True
- Managed
- Managed
- False
-
-
-
-
-
\ No newline at end of file
diff --git a/MapControl/PanelBase.cs b/MapControl/PanelBase.cs
index 5bfa7463..b895a4d6 100644
--- a/MapControl/PanelBase.cs
+++ b/MapControl/PanelBase.cs
@@ -9,7 +9,6 @@ using Windows.UI.Xaml.Controls;
#else
using System.Windows;
using System.Windows.Controls;
-
#endif
namespace MapControl
diff --git a/MapControl/Properties/AssemblyInfo.cs b/MapControl/Properties/AssemblyInfo.cs
index 97cb566c..a997374a 100644
--- a/MapControl/Properties/AssemblyInfo.cs
+++ b/MapControl/Properties/AssemblyInfo.cs
@@ -17,8 +17,8 @@ using System.Windows;
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")]
[assembly: AssemblyTrademark("")]
-[assembly: AssemblyVersion("2.3.0")]
-[assembly: AssemblyFileVersion("2.3.0")]
+[assembly: AssemblyVersion("2.3.1")]
+[assembly: AssemblyFileVersion("2.3.1")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
diff --git a/MapControl/TileContainer.Silverlight.WinRT.cs b/MapControl/TileContainer.Silverlight.WinRT.cs
index 2e14305d..5f651356 100644
--- a/MapControl/TileContainer.Silverlight.WinRT.cs
+++ b/MapControl/TileContainer.Silverlight.WinRT.cs
@@ -4,8 +4,10 @@
using System;
#if WINDOWS_RUNTIME
+using Windows.Foundation;
using Windows.UI.Xaml.Media;
#else
+using System.Windows;
using System.Windows.Media;
#endif
@@ -21,11 +23,13 @@ namespace MapControl
.Scale(scale, -scale); // map coordinates to tile indices
}
- private void UpdateViewportTransform(double scale, double offsetX, double offsetY)
+ private void UpdateViewportTransform(double scale, Point mapOrigin)
{
ViewportTransform.Matrix =
- new Matrix(scale, 0d, 0d, -scale, offsetX, offsetY)
- .RotateAt(rotation, viewportOrigin.X, viewportOrigin.Y);
+ new Matrix(1d, 0d, 0d, 1d, -mapOrigin.X, -mapOrigin.Y)
+ .Scale(scale, -scale)
+ .Rotate(rotation)
+ .Translate(viewportOrigin.X, viewportOrigin.Y);
}
///
diff --git a/MapControl/TileContainer.WPF.cs b/MapControl/TileContainer.WPF.cs
index 378ac839..a72dc78d 100644
--- a/MapControl/TileContainer.WPF.cs
+++ b/MapControl/TileContainer.WPF.cs
@@ -3,6 +3,7 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
+using System.Windows;
using System.Windows.Media;
namespace MapControl
@@ -19,10 +20,12 @@ namespace MapControl
return transform;
}
- private void UpdateViewportTransform(double scale, double offsetX, double offsetY)
+ private void UpdateViewportTransform(double scale, Point mapOrigin)
{
- var transform = new Matrix(scale, 0d, 0d, -scale, offsetX, offsetY);
- transform.RotateAt(rotation, viewportOrigin.X, viewportOrigin.Y);
+ var transform = new Matrix(1d, 0d, 0d, 1d, -mapOrigin.X, -mapOrigin.Y);
+ transform.Scale(scale, -scale);
+ transform.Rotate(rotation);
+ transform.Translate(viewportOrigin.X, viewportOrigin.Y);
ViewportTransform.Matrix = transform;
}
diff --git a/MapControl/TileContainer.cs b/MapControl/TileContainer.cs
index 3abd3942..236355f9 100644
--- a/MapControl/TileContainer.cs
+++ b/MapControl/TileContainer.cs
@@ -23,7 +23,6 @@ namespace MapControl
private static double zoomLevelSwitchDelta = -Math.Log(0.75, 2d);
private readonly DispatcherTimer updateTimer;
- private Size viewportSize;
private Point viewportOrigin;
private Point tileLayerOffset;
private double rotation;
@@ -82,7 +81,7 @@ namespace MapControl
Children.Clear();
}
- public double SetViewportTransform(double mapZoomLevel, double mapRotation, Point mapOrigin, Point vpOrigin, Size vpSize)
+ public double SetViewportTransform(double mapZoomLevel, double mapRotation, Point mapOrigin, Point viewOrigin)
{
var scale = Math.Pow(2d, zoomLevel) * TileSource.TileSize / 360d;
var oldMapOriginX = (viewportOrigin.X - tileLayerOffset.X) / scale - 180d;
@@ -94,17 +93,11 @@ namespace MapControl
}
rotation = mapRotation;
- viewportSize = vpSize;
- viewportOrigin = vpOrigin;
-
- var transformOffsetX = viewportOrigin.X - mapOrigin.X * scale;
- var transformOffsetY = viewportOrigin.Y + mapOrigin.Y * scale;
-
- UpdateViewportTransform(scale, transformOffsetX, transformOffsetY);
-
- tileLayerOffset.X = transformOffsetX - 180d * scale;
- tileLayerOffset.Y = transformOffsetY - 180d * scale;
+ viewportOrigin = viewOrigin;
+ tileLayerOffset.X = viewportOrigin.X - (180d + mapOrigin.X) * scale;
+ tileLayerOffset.Y = viewportOrigin.Y - (180d - mapOrigin.Y) * scale;
+ UpdateViewportTransform(scale, mapOrigin);
UpdateRenderTransform();
if (Math.Abs(mapOrigin.X - oldMapOriginX) > 180d)
@@ -130,9 +123,9 @@ namespace MapControl
// tile indices of visible rectangle
var p1 = transform.Transform(new Point(0d, 0d));
- var p2 = transform.Transform(new Point(viewportSize.Width, 0d));
- var p3 = transform.Transform(new Point(0d, viewportSize.Height));
- var p4 = transform.Transform(new Point(viewportSize.Width, viewportSize.Height));
+ var p2 = transform.Transform(new Point(RenderSize.Width, 0d));
+ var p3 = transform.Transform(new Point(0d, RenderSize.Height));
+ var p4 = transform.Transform(new Point(RenderSize.Width, RenderSize.Height));
// index ranges of visible tiles
var x1 = (int)Math.Floor(Math.Min(p1.X, Math.Min(p2.X, Math.Min(p3.X, p4.X))));
diff --git a/MapControl/WinRT/Properties/AssemblyInfo.cs b/MapControl/WinRT/Properties/AssemblyInfo.cs
index 6bbff177..863cdd8d 100644
--- a/MapControl/WinRT/Properties/AssemblyInfo.cs
+++ b/MapControl/WinRT/Properties/AssemblyInfo.cs
@@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")]
[assembly: AssemblyTrademark("")]
-[assembly: AssemblyVersion("2.3.0")]
-[assembly: AssemblyFileVersion("2.3.0")]
+[assembly: AssemblyVersion("2.3.1")]
+[assembly: AssemblyFileVersion("2.3.1")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
diff --git a/SampleApps/PhoneApplication/MainPage.xaml.cs b/SampleApps/PhoneApplication/MainPage.xaml.cs
index 6764fdf1..5894b352 100644
--- a/SampleApps/PhoneApplication/MainPage.xaml.cs
+++ b/SampleApps/PhoneApplication/MainPage.xaml.cs
@@ -15,7 +15,7 @@ namespace PhoneApplication
public MainPage()
{
- TileImageLoader.Cache = new ImageFileCache();
+ //TileImageLoader.Cache = new ImageFileCache();
//BingMapsTileLayer.ApiKey = ...
InitializeComponent();
diff --git a/SampleApps/PhoneApplication/PhoneApplication.csproj b/SampleApps/PhoneApplication/PhoneApplication.csproj
index ec1fd6f6..1dbec885 100644
--- a/SampleApps/PhoneApplication/PhoneApplication.csproj
+++ b/SampleApps/PhoneApplication/PhoneApplication.csproj
@@ -34,50 +34,6 @@
prompt
4
-
- true
- bin\ARM\Debug\
- DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP
- ;2008
- full
- ARM
- false
- prompt
- true
-
-
- bin\ARM\Release\
- TRACE;NETFX_CORE;WINDOWS_PHONE_APP
- true
- ;2008
- pdbonly
- ARM
- false
- prompt
- true
-
-
- true
- bin\x86\Debug\
- DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP
- ;2008
- full
- x86
- false
- prompt
- true
-
-
- bin\x86\Release\
- TRACE;NETFX_CORE;WINDOWS_PHONE_APP
- true
- ;2008
- pdbonly
- x86
- false
- prompt
- true
-
diff --git a/SampleApps/PhoneApplication/Properties/AssemblyInfo.cs b/SampleApps/PhoneApplication/Properties/AssemblyInfo.cs
index b71720b9..7eb52202 100644
--- a/SampleApps/PhoneApplication/Properties/AssemblyInfo.cs
+++ b/SampleApps/PhoneApplication/Properties/AssemblyInfo.cs
@@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")]
[assembly: AssemblyTrademark("")]
-[assembly: AssemblyVersion("2.3.0")]
-[assembly: AssemblyFileVersion("2.3.0")]
+[assembly: AssemblyVersion("2.3.1")]
+[assembly: AssemblyFileVersion("2.3.1")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
diff --git a/SampleApps/SilverlightApplication.Web/Properties/AssemblyInfo.cs b/SampleApps/SilverlightApplication.Web/Properties/AssemblyInfo.cs
index e658088b..fbbfcba2 100644
--- a/SampleApps/SilverlightApplication.Web/Properties/AssemblyInfo.cs
+++ b/SampleApps/SilverlightApplication.Web/Properties/AssemblyInfo.cs
@@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")]
[assembly: AssemblyTrademark("")]
-[assembly: AssemblyVersion("2.3.0")]
-[assembly: AssemblyFileVersion("2.3.0")]
+[assembly: AssemblyVersion("2.3.1")]
+[assembly: AssemblyFileVersion("2.3.1")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
diff --git a/SampleApps/SilverlightApplication/MainPage.xaml.cs b/SampleApps/SilverlightApplication/MainPage.xaml.cs
index 43a62147..744ae304 100644
--- a/SampleApps/SilverlightApplication/MainPage.xaml.cs
+++ b/SampleApps/SilverlightApplication/MainPage.xaml.cs
@@ -22,11 +22,6 @@ namespace SilverlightApplication
tileLayerComboBox.SelectedIndex = 0;
}
- private void MapMouseLeave(object sender, MouseEventArgs e)
- {
- mouseLocation.Text = string.Empty;
- }
-
private void MapMouseMove(object sender, MouseEventArgs e)
{
var location = map.ViewportPointToLocation(e.GetPosition(map));
@@ -53,6 +48,11 @@ namespace SilverlightApplication
lonHemisphere, longitude / 60000, (double)(longitude % 60000) / 1000d);
}
+ private void MapMouseLeave(object sender, MouseEventArgs e)
+ {
+ mouseLocation.Text = string.Empty;
+ }
+
private void TileLayerSelectionChanged(object sender, SelectionChangedEventArgs e)
{
var selectedItem = (ComboBoxItem)tileLayerComboBox.SelectedItem;
diff --git a/SampleApps/SilverlightApplication/Properties/AssemblyInfo.cs b/SampleApps/SilverlightApplication/Properties/AssemblyInfo.cs
index 490b51d4..a26f5743 100644
--- a/SampleApps/SilverlightApplication/Properties/AssemblyInfo.cs
+++ b/SampleApps/SilverlightApplication/Properties/AssemblyInfo.cs
@@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")]
[assembly: AssemblyTrademark("")]
-[assembly: AssemblyVersion("2.3.0")]
-[assembly: AssemblyFileVersion("2.3.0")]
+[assembly: AssemblyVersion("2.3.1")]
+[assembly: AssemblyFileVersion("2.3.1")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
diff --git a/SampleApps/StoreApplication/MainPage.xaml b/SampleApps/StoreApplication/MainPage.xaml
index f30eda6d..42b3e8a6 100644
--- a/SampleApps/StoreApplication/MainPage.xaml
+++ b/SampleApps/StoreApplication/MainPage.xaml
@@ -158,7 +158,8 @@
-
+
diff --git a/SampleApps/StoreApplication/MainPage.xaml.cs b/SampleApps/StoreApplication/MainPage.xaml.cs
index c8f2ccfe..89d317d7 100644
--- a/SampleApps/StoreApplication/MainPage.xaml.cs
+++ b/SampleApps/StoreApplication/MainPage.xaml.cs
@@ -11,7 +11,7 @@ namespace StoreApplication
public MainPage()
{
- TileImageLoader.Cache = new ImageFileCache();
+ //TileImageLoader.Cache = new ImageFileCache();
//BingMapsTileLayer.ApiKey = ...
this.InitializeComponent();
diff --git a/SampleApps/StoreApplication/Properties/AssemblyInfo.cs b/SampleApps/StoreApplication/Properties/AssemblyInfo.cs
index 3a136e6e..730607f2 100644
--- a/SampleApps/StoreApplication/Properties/AssemblyInfo.cs
+++ b/SampleApps/StoreApplication/Properties/AssemblyInfo.cs
@@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")]
[assembly: AssemblyTrademark("")]
-[assembly: AssemblyVersion("2.3.0")]
-[assembly: AssemblyFileVersion("2.3.0")]
+[assembly: AssemblyVersion("2.3.1")]
+[assembly: AssemblyFileVersion("2.3.1")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
diff --git a/SampleApps/WpfApplication/MainWindow.xaml.cs b/SampleApps/WpfApplication/MainWindow.xaml.cs
index 366b0489..1b59771b 100644
--- a/SampleApps/WpfApplication/MainWindow.xaml.cs
+++ b/SampleApps/WpfApplication/MainWindow.xaml.cs
@@ -58,11 +58,6 @@ namespace WpfApplication
}
}
- private void MapMouseLeave(object sender, MouseEventArgs e)
- {
- mouseLocation.Text = string.Empty;
- }
-
private void MapMouseMove(object sender, MouseEventArgs e)
{
var location = map.ViewportPointToLocation(e.GetPosition(map));
@@ -89,6 +84,11 @@ namespace WpfApplication
lonHemisphere, longitude / 60000, (double)(longitude % 60000) / 1000d);
}
+ private void MapMouseLeave(object sender, MouseEventArgs e)
+ {
+ mouseLocation.Text = string.Empty;
+ }
+
private void MapManipulationInertiaStarting(object sender, ManipulationInertiaStartingEventArgs e)
{
e.TranslationBehavior.DesiredDeceleration = 0.001;
diff --git a/SampleApps/WpfApplication/Properties/AssemblyInfo.cs b/SampleApps/WpfApplication/Properties/AssemblyInfo.cs
index 73ff51b7..43d11d8a 100644
--- a/SampleApps/WpfApplication/Properties/AssemblyInfo.cs
+++ b/SampleApps/WpfApplication/Properties/AssemblyInfo.cs
@@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")]
[assembly: AssemblyTrademark("")]
-[assembly: AssemblyVersion("2.3.0")]
-[assembly: AssemblyFileVersion("2.3.0")]
+[assembly: AssemblyVersion("2.3.1")]
+[assembly: AssemblyFileVersion("2.3.1")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]