Version 2.11.0: Fixed TargetCenter animation.

This commit is contained in:
ClemensF 2016-07-03 00:03:38 +02:00
parent 90ad98df33
commit 43672bb693
18 changed files with 57 additions and 64 deletions

View file

@ -112,7 +112,7 @@ namespace MapControl.Caching
public override DefaultCacheCapabilities DefaultCacheCapabilities public override DefaultCacheCapabilities DefaultCacheCapabilities
{ {
get { return DefaultCacheCapabilities.InMemoryProvider | DefaultCacheCapabilities.AbsoluteExpirations | DefaultCacheCapabilities.SlidingExpirations; } get { return DefaultCacheCapabilities.AbsoluteExpirations | DefaultCacheCapabilities.SlidingExpirations; }
} }
public override object this[string key] public override object this[string key]
@ -266,16 +266,16 @@ namespace MapControl.Caching
} }
} }
public override void Set(CacheItem item, CacheItemPolicy policy)
{
Set(item.Key, item.Value, policy, item.RegionName);
}
public override void Set(string key, object value, DateTimeOffset absoluteExpiration, string regionName = null) public override void Set(string key, object value, DateTimeOffset absoluteExpiration, string regionName = null)
{ {
Set(key, value, new CacheItemPolicy { AbsoluteExpiration = absoluteExpiration }, regionName); Set(key, value, new CacheItemPolicy { AbsoluteExpiration = absoluteExpiration }, regionName);
} }
public override void Set(CacheItem item, CacheItemPolicy policy)
{
Set(item.Key, item.Value, policy, item.RegionName);
}
public override object AddOrGetExisting(string key, object value, CacheItemPolicy policy, string regionName = null) public override object AddOrGetExisting(string key, object value, CacheItemPolicy policy, string regionName = null)
{ {
var oldValue = Get(key, regionName); var oldValue = Get(key, regionName);
@ -285,6 +285,11 @@ namespace MapControl.Caching
return oldValue; return oldValue;
} }
public override object AddOrGetExisting(string key, object value, DateTimeOffset absoluteExpiration, string regionName = null)
{
return AddOrGetExisting(key, value, new CacheItemPolicy { AbsoluteExpiration = absoluteExpiration }, regionName);
}
public override CacheItem AddOrGetExisting(CacheItem item, CacheItemPolicy policy) public override CacheItem AddOrGetExisting(CacheItem item, CacheItemPolicy policy)
{ {
var oldItem = GetCacheItem(item.Key, item.RegionName); var oldItem = GetCacheItem(item.Key, item.RegionName);
@ -294,11 +299,6 @@ namespace MapControl.Caching
return oldItem; return oldItem;
} }
public override object AddOrGetExisting(string key, object value, DateTimeOffset absoluteExpiration, string regionName = null)
{
return AddOrGetExisting(key, value, new CacheItemPolicy { AbsoluteExpiration = absoluteExpiration }, regionName);
}
public override object Remove(string key, string regionName = null) public override object Remove(string key, string regionName = null)
{ {
var oldValue = Get(key, regionName); var oldValue = Get(key, regionName);
@ -395,7 +395,7 @@ namespace MapControl.Caching
} }
catch (Exception ex) catch (Exception ex)
{ {
Debug.WriteLine("FileDbCache: Creating database {0}: {1}", path, ex.Message); Debug.WriteLine("FileDbCache: Failed creating database {0}: {1}", path, ex.Message);
} }
return false; return false;

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("© 2016 Clemens Fischer")] [assembly: AssemblyCopyright("© 2016 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("2.10.0")] [assembly: AssemblyVersion("2.11.0")]
[assembly: AssemblyFileVersion("2.10.0")] [assembly: AssemblyFileVersion("2.11.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("© 2016 Clemens Fischer")] [assembly: AssemblyCopyright("© 2016 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("2.10.0")] [assembly: AssemblyVersion("2.11.0")]
[assembly: AssemblyFileVersion("2.10.0")] [assembly: AssemblyFileVersion("2.11.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -70,7 +70,7 @@ namespace MapControl.Caching
public override DefaultCacheCapabilities DefaultCacheCapabilities public override DefaultCacheCapabilities DefaultCacheCapabilities
{ {
get { return DefaultCacheCapabilities.InMemoryProvider; } get { return DefaultCacheCapabilities.None; }
} }
public override object this[string key] public override object this[string key]
@ -137,7 +137,7 @@ namespace MapControl.Caching
} }
catch (Exception ex) catch (Exception ex)
{ {
Debug.WriteLine("ImageFileCache: Reading {0}: {1}", path, ex.Message); Debug.WriteLine("ImageFileCache: Failed reading {0}: {1}", path, ex.Message);
} }
} }
} }
@ -193,20 +193,20 @@ namespace MapControl.Caching
} }
catch (Exception ex) catch (Exception ex)
{ {
Debug.WriteLine("ImageFileCache: Writing {0}: {1}", path, ex.Message); Debug.WriteLine("ImageFileCache: Failed writing {0}: {1}", path, ex.Message);
} }
} }
public override void Set(CacheItem item, CacheItemPolicy policy)
{
Set(item.Key, item.Value, policy, item.RegionName);
}
public override void Set(string key, object value, DateTimeOffset absoluteExpiration, string regionName = null) public override void Set(string key, object value, DateTimeOffset absoluteExpiration, string regionName = null)
{ {
Set(key, value, new CacheItemPolicy { AbsoluteExpiration = absoluteExpiration }, regionName); Set(key, value, new CacheItemPolicy { AbsoluteExpiration = absoluteExpiration }, regionName);
} }
public override void Set(CacheItem item, CacheItemPolicy policy)
{
Set(item.Key, item.Value, policy, item.RegionName);
}
public override object AddOrGetExisting(string key, object value, CacheItemPolicy policy, string regionName = null) public override object AddOrGetExisting(string key, object value, CacheItemPolicy policy, string regionName = null)
{ {
var oldValue = Get(key, regionName); var oldValue = Get(key, regionName);
@ -216,6 +216,11 @@ namespace MapControl.Caching
return oldValue; return oldValue;
} }
public override object AddOrGetExisting(string key, object value, DateTimeOffset absoluteExpiration, string regionName = null)
{
return AddOrGetExisting(key, value, new CacheItemPolicy { AbsoluteExpiration = absoluteExpiration }, regionName);
}
public override CacheItem AddOrGetExisting(CacheItem item, CacheItemPolicy policy) public override CacheItem AddOrGetExisting(CacheItem item, CacheItemPolicy policy)
{ {
var oldItem = GetCacheItem(item.Key, item.RegionName); var oldItem = GetCacheItem(item.Key, item.RegionName);
@ -225,11 +230,6 @@ namespace MapControl.Caching
return oldItem; return oldItem;
} }
public override object AddOrGetExisting(string key, object value, DateTimeOffset absoluteExpiration, string regionName = null)
{
return AddOrGetExisting(key, value, new CacheItemPolicy { AbsoluteExpiration = absoluteExpiration }, regionName);
}
public override object Remove(string key, string regionName = null) public override object Remove(string key, string regionName = null)
{ {
if (key == null) if (key == null)
@ -254,7 +254,7 @@ namespace MapControl.Caching
} }
catch (Exception ex) catch (Exception ex)
{ {
Debug.WriteLine("ImageFileCache: Removing {0}: {1}", path, ex.Message); Debug.WriteLine("ImageFileCache: Failed removing {0}: {1}", path, ex.Message);
} }
} }
@ -281,7 +281,7 @@ namespace MapControl.Caching
} }
catch (Exception ex) catch (Exception ex)
{ {
Debug.WriteLine("ImageFileCache: Finding {0}: {1}", path, ex.Message); Debug.WriteLine("ImageFileCache: Failed finding {0}: {1}", path, ex.Message);
} }
return null; return null;

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("© 2016 Clemens Fischer")] [assembly: AssemblyCopyright("© 2016 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("2.10.0")] [assembly: AssemblyVersion("2.11.0")]
[assembly: AssemblyFileVersion("2.10.0")] [assembly: AssemblyFileVersion("2.11.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("© 2016 Clemens Fischer")] [assembly: AssemblyCopyright("© 2016 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("2.10.0")] [assembly: AssemblyVersion("2.11.0")]
[assembly: AssemblyFileVersion("2.10.0")] [assembly: AssemblyFileVersion("2.11.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14 # Visual Studio 14
VisualStudioVersion = 14.0.24720.0 VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileDbCache.WinRT", "Caching\FileDbCache.WinRT\FileDbCache.WinRT.csproj", "{C7BF2B18-CC74-430B-BCB2-600304EFA3D8}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileDbCache.WinRT", "Caching\FileDbCache.WinRT\FileDbCache.WinRT.csproj", "{C7BF2B18-CC74-430B-BCB2-600304EFA3D8}"
EndProject EndProject

View file

@ -618,6 +618,7 @@ namespace MapControl
// animate private CenterPoint property by PointAnimation // animate private CenterPoint property by PointAnimation
centerAnimation = new PointAnimation centerAnimation = new PointAnimation
{ {
From = mapTransform.Transform(Center),
To = mapTransform.Transform(new Location( To = mapTransform.Transform(new Location(
targetCenter.Latitude, targetCenter.Latitude,
Location.NearestLongitude(targetCenter.Longitude, Center.Longitude))), Location.NearestLongitude(targetCenter.Longitude, Center.Longitude))),
@ -647,6 +648,7 @@ namespace MapControl
private void CenterPointPropertyChanged(Point centerPoint) private void CenterPointPropertyChanged(Point centerPoint)
{ {
System.Diagnostics.Debug.WriteLine("CenterPoint: {0}", centerPoint);
if (!internalPropertyChange) if (!internalPropertyChange)
{ {
centerPoint.X = Location.NormalizeLongitude(centerPoint.X); centerPoint.X = Location.NormalizeLongitude(centerPoint.X);
@ -862,12 +864,7 @@ namespace MapControl
{ {
base.OnViewportChanged(); base.OnViewportChanged();
var viewportChanged = ViewportChanged; ViewportChanged?.Invoke(this, EventArgs.Empty);
if (viewportChanged != null)
{
viewportChanged(this, EventArgs.Empty);
}
} }
} }
} }

View file

@ -14,8 +14,8 @@ using System.Windows;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("© 2016 Clemens Fischer")] [assembly: AssemblyCopyright("© 2016 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("2.10.0")] [assembly: AssemblyVersion("2.11.0")]
[assembly: AssemblyFileVersion("2.10.0")] [assembly: AssemblyFileVersion("2.11.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -271,11 +271,6 @@ namespace MapControl
return image; return image;
} }
private static string TileKey(TileSource tileSource, Tile tile)
{
return string.Format("{0:X}/{1:X}/{2:X}/{3:X}", tileSource.GetHashCode(), tile.ZoomLevel, tile.XIndex, tile.Y);
}
private static string CacheKey(string sourceName, Tile tile) private static string CacheKey(string sourceName, Tile tile)
{ {
return string.IsNullOrEmpty(sourceName) ? null : string.Format("{0}/{1}/{2}/{3}", sourceName, tile.ZoomLevel, tile.XIndex, tile.Y); return string.IsNullOrEmpty(sourceName) ? null : string.Format("{0}/{1}/{2}/{3}", sourceName, tile.ZoomLevel, tile.XIndex, tile.Y);

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("© 2016 Clemens Fischer")] [assembly: AssemblyCopyright("© 2016 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("2.10.0")] [assembly: AssemblyVersion("2.11.0")]
[assembly: AssemblyFileVersion("2.10.0")] [assembly: AssemblyFileVersion("2.11.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("© 2016 Clemens Fischer")] [assembly: AssemblyCopyright("© 2016 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("2.10.0")] [assembly: AssemblyVersion("2.11.0")]
[assembly: AssemblyFileVersion("2.10.0")] [assembly: AssemblyFileVersion("2.11.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("© 2016 Clemens Fischer")] [assembly: AssemblyCopyright("© 2016 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("2.10.0")] [assembly: AssemblyVersion("2.11.0")]
[assembly: AssemblyFileVersion("2.10.0")] [assembly: AssemblyFileVersion("2.11.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("© 2016 Clemens Fischer")] [assembly: AssemblyCopyright("© 2016 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("2.10.0")] [assembly: AssemblyVersion("2.11.0")]
[assembly: AssemblyFileVersion("2.10.0")] [assembly: AssemblyFileVersion("2.11.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("© 2015 Clemens Fischer")] [assembly: AssemblyCopyright("© 2015 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("2.10.0")] [assembly: AssemblyVersion("2.11.0")]
[assembly: AssemblyFileVersion("2.10.0")] [assembly: AssemblyFileVersion("2.11.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("© 2016 Clemens Fischer")] [assembly: AssemblyCopyright("© 2016 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("2.10.0")] [assembly: AssemblyVersion("2.11.0")]
[assembly: AssemblyFileVersion("2.10.0")] [assembly: AssemblyFileVersion("2.11.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("© 2016 Clemens Fischer")] [assembly: AssemblyCopyright("© 2016 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("2.10.0")] [assembly: AssemblyVersion("2.11.0")]
[assembly: AssemblyFileVersion("2.10.0")] [assembly: AssemblyFileVersion("2.11.0")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -13,6 +13,7 @@
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>