mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-07 23:45:05 +00:00
Version 4.13.1 Cache "no tile" responses.
This commit is contained in:
parent
576dd8e8e7
commit
219171381f
27 changed files with 200 additions and 338 deletions
|
|
@ -1,63 +0,0 @@
|
|||
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
||||
// © 2019 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
#if WINDOWS_UWP
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Data;
|
||||
#else
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
#endif
|
||||
|
||||
namespace MapControl.Images
|
||||
{
|
||||
public class ZoomLevelToOpacityConverter : IValueConverter
|
||||
{
|
||||
public double MinZoomLevel { get; set; } = 0d;
|
||||
public double MaxZoomLevel { get; set; } = 22d;
|
||||
public double FadeZoomRange { get; set; } = 1d;
|
||||
public double MaxOpacity { get; set; } = 1d;
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (!(value is double))
|
||||
{
|
||||
return DependencyProperty.UnsetValue;
|
||||
}
|
||||
|
||||
var zoomLevel = (double)value;
|
||||
var opacity = 0d;
|
||||
|
||||
if (zoomLevel > MinZoomLevel && zoomLevel < MaxZoomLevel)
|
||||
{
|
||||
opacity = MaxOpacity;
|
||||
|
||||
if (FadeZoomRange > 0d)
|
||||
{
|
||||
opacity = Math.Min(opacity, (zoomLevel - MinZoomLevel) / FadeZoomRange);
|
||||
opacity = Math.Min(opacity, (MaxZoomLevel - zoomLevel) / FadeZoomRange);
|
||||
}
|
||||
}
|
||||
|
||||
return opacity;
|
||||
}
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
return Convert(value, targetType, parameter, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -46,9 +46,6 @@
|
|||
<Compile Include="..\Shared\WorldFileImage.cs">
|
||||
<Link>WorldFileImage.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Shared\ZoomLevelToOpacityConverter.cs">
|
||||
<Link>ZoomLevelToOpacityConverter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Properties\MapImages.UWP.rd.xml" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("4.13.0")]
|
||||
[assembly: AssemblyFileVersion("4.13.0")]
|
||||
[assembly: AssemblyVersion("4.13.1")]
|
||||
[assembly: AssemblyFileVersion("4.13.1")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -54,9 +54,6 @@
|
|||
<Compile Include="..\Shared\WorldFileImage.cs">
|
||||
<Link>WorldFileImage.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Shared\ZoomLevelToOpacityConverter.cs">
|
||||
<Link>ZoomLevelToOpacityConverter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("4.13.0")]
|
||||
[assembly: AssemblyFileVersion("4.13.0")]
|
||||
[assembly: AssemblyVersion("4.13.1")]
|
||||
[assembly: AssemblyFileVersion("4.13.1")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue