mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-08 16:05:50 +00:00
Image loading with cancellation
This commit is contained in:
parent
81eabef257
commit
69bba213f0
13 changed files with 103 additions and 88 deletions
|
|
@ -5,6 +5,8 @@ using System.Globalization;
|
|||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
using System.Threading;
|
||||
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
|
@ -162,7 +164,7 @@ namespace MapControl
|
|||
/// <summary>
|
||||
/// Loads an ImageSource from the URL returned by GetMapRequestUri().
|
||||
/// </summary>
|
||||
protected override async Task<ImageSource> GetImageAsync(BoundingBox boundingBox, IProgress<double> progress)
|
||||
protected override async Task<ImageSource> GetImageAsync(BoundingBox boundingBox, IProgress<double> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
ImageSource image = null;
|
||||
|
||||
|
|
@ -185,7 +187,7 @@ namespace MapControl
|
|||
|
||||
if (uri != null)
|
||||
{
|
||||
image = await ImageLoader.LoadImageAsync(new Uri(uri), progress);
|
||||
image = await ImageLoader.LoadImageAsync(new Uri(uri), progress, cancellationToken);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -208,7 +210,7 @@ namespace MapControl
|
|||
|
||||
if (uri1 != null && uri2 != null)
|
||||
{
|
||||
image = await ImageLoader.LoadMergedImageAsync(new Uri(uri1), new Uri(uri2), progress);
|
||||
image = await ImageLoader.LoadMergedImageAsync(new Uri(uri1), new Uri(uri2), progress, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue