mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Version 4.10.0: Improved ImageLoader and MBTiles.
This commit is contained in:
parent
eca9178971
commit
bdcd2597a1
13 changed files with 403 additions and 339 deletions
|
|
@ -51,27 +51,20 @@ namespace MapControl
|
|||
return imageSource;
|
||||
}
|
||||
|
||||
public static async Task<ImageSource> LoadHttpImageAsync(Uri uri)
|
||||
private static async Task<ImageSource> LoadHttpImageAsync(Uri uri)
|
||||
{
|
||||
ImageSource imageSource = null;
|
||||
|
||||
try
|
||||
using (var response = await HttpClient.GetAsync(uri))
|
||||
{
|
||||
using (var response = await HttpClient.GetAsync(uri))
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
Debug.WriteLine("ImageLoader: {0}: {1} {2}", uri, (int)response.StatusCode, response.ReasonPhrase);
|
||||
}
|
||||
else if (IsTileAvailable(response.Headers))
|
||||
{
|
||||
imageSource = await CreateImageSourceAsync(response.Content);
|
||||
}
|
||||
Debug.WriteLine("ImageLoader: {0}: {1} {2}", uri, (int)response.StatusCode, response.ReasonPhrase);
|
||||
}
|
||||
else if (IsTileAvailable(response.Headers))
|
||||
{
|
||||
imageSource = await CreateImageSourceAsync(response.Content);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine("ImageLoader: {0}: {1}", uri, ex.Message);
|
||||
}
|
||||
|
||||
return imageSource;
|
||||
|
|
|
|||
|
|
@ -4,9 +4,13 @@
|
|||
|
||||
using System;
|
||||
#if WINDOWS_UWP
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Media.Animation;
|
||||
#else
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media.Animation;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
@ -37,5 +41,11 @@ namespace MapControl
|
|||
return ((X % numTiles) + numTiles) % numTiles;
|
||||
}
|
||||
}
|
||||
|
||||
private void FadeIn()
|
||||
{
|
||||
Image.BeginAnimation(UIElement.OpacityProperty, new DoubleAnimation { From = 0d, To = 1d, Duration = FadeDuration, FillBehavior = FillBehavior.Stop });
|
||||
Image.Opacity = 1d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue