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
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#if WPF
|
||||
using System.Windows.Media;
|
||||
|
|
@ -73,11 +74,11 @@ namespace MapControl
|
|||
/// Loads a tile ImageSource asynchronously from GetUri(column, row, zoomLevel).
|
||||
/// This method is called by TileImageLoader when caching is disabled.
|
||||
/// </summary>
|
||||
public virtual Task<ImageSource> LoadImageAsync(int column, int row, int zoomLevel)
|
||||
public virtual Task<ImageSource> LoadImageAsync(int column, int row, int zoomLevel, CancellationToken cancellationToken)
|
||||
{
|
||||
var uri = GetUri(column, row, zoomLevel);
|
||||
|
||||
return uri != null ? ImageLoader.LoadImageAsync(uri) : Task.FromResult((ImageSource)null);
|
||||
return uri != null ? ImageLoader.LoadImageAsync(uri, null, cancellationToken) : Task.FromResult((ImageSource)null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue