mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-08 07:55:13 +00:00
Image loading with cancellation
This commit is contained in:
parent
545e49b306
commit
220597ab31
5 changed files with 14 additions and 8 deletions
|
|
@ -7,6 +7,7 @@ using System.Collections.Concurrent;
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Policy;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#if WPF
|
||||
|
|
@ -102,10 +103,12 @@ namespace MapControl
|
|||
|
||||
progress?.Report((double)(tileCount - pendingTiles.Count) / tileCount);
|
||||
|
||||
var requestCancellationToken = RequestCancellationEnabled ? cancellationToken : CancellationToken.None;
|
||||
Logger?.LogTrace("[{thread}] Loading tile image {zoom}/{column}/{row}", Environment.CurrentManagedThreadId, tile.ZoomLevel, tile.Column, tile.Row);
|
||||
|
||||
try
|
||||
{
|
||||
var requestCancellationToken = RequestCancellationEnabled ? cancellationToken : CancellationToken.None;
|
||||
|
||||
await LoadTileImage(tile, tileSource, cacheName, requestCancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue