mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Moved method from TileImageLoader to TileSource
This commit is contained in:
parent
fa160ff138
commit
7cb7d81f15
|
|
@ -119,9 +119,7 @@ namespace MapControl
|
|||
}
|
||||
}
|
||||
|
||||
protected virtual Task<ImageSource> LoadImageAsync(byte[] buffer) => ImageLoader.LoadImageAsync(buffer);
|
||||
|
||||
private async Task LoadTileAsync(Tile tile, TileSource tileSource, string cacheName)
|
||||
private static async Task LoadTileAsync(Tile tile, TileSource tileSource, string cacheName)
|
||||
{
|
||||
Func<Task<ImageSource>> loadImageFunc;
|
||||
|
||||
|
|
@ -139,7 +137,7 @@ namespace MapControl
|
|||
|
||||
if (buffer == null || buffer.Length == 0) return;
|
||||
|
||||
loadImageFunc = () => LoadImageAsync(buffer);
|
||||
loadImageFunc = () => tileSource.LoadImageAsync(buffer);
|
||||
}
|
||||
|
||||
await LoadTileAsync(tile, loadImageFunc).ConfigureAwait(false); // loadImageFunc runs in UI thread in WinUI/UWP
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ namespace MapControl
|
|||
|
||||
/// <summary>
|
||||
/// Loads a tile ImageSource asynchronously from GetUri(column, row, zoomLevel).
|
||||
/// This method is called by TileImageLoader for TileSources without caching.
|
||||
/// This method is called by TileImageLoader when caching is disabled.
|
||||
/// </summary>
|
||||
public virtual Task<ImageSource> LoadImageAsync(int column, int row, int zoomLevel)
|
||||
{
|
||||
|
|
@ -84,6 +84,12 @@ namespace MapControl
|
|||
return uri != null ? ImageLoader.LoadImageAsync(uri) : Task.FromResult((ImageSource)null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads a tile ImageSource asynchronously from an encoded frame buffer in a byte array.
|
||||
/// This method is called by TileImageLoader when caching is enabled.
|
||||
/// </summary>
|
||||
public virtual Task<ImageSource> LoadImageAsync(byte[] buffer) => ImageLoader.LoadImageAsync(buffer);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a TileSource instance from an Uri template string.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue