mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Update TileImageLoader.cs
This commit is contained in:
parent
2cf8636f4c
commit
fce05c2ed1
|
|
@ -121,12 +121,12 @@ namespace MapControl
|
||||||
{
|
{
|
||||||
tile.IsPending = false;
|
tile.IsPending = false;
|
||||||
|
|
||||||
var tilesLoaded = tileCount - tileStack.Count;
|
var tileNumber = tileCount - tileStack.Count;
|
||||||
|
|
||||||
progress?.Report((double)tilesLoaded / tileCount);
|
progress?.Report((double)tileNumber / tileCount);
|
||||||
|
|
||||||
Logger?.LogTrace("[{thread}] Loading tile {loaded} of {count}: {zoom}/{column}/{row}",
|
Logger?.LogTrace("Loading tile {number} of {count} ({zoom}/{column}/{row}) in thread {thread}",
|
||||||
Environment.CurrentManagedThreadId, tilesLoaded, tileCount, tile.ZoomLevel, tile.Column, tile.Row);
|
tileNumber, tileCount, tile.ZoomLevel, tile.Column, tile.Row, Environment.CurrentManagedThreadId);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -170,8 +170,6 @@ namespace MapControl
|
||||||
|
|
||||||
private static async Task<byte[]> LoadCachedBuffer(Tile tile, Uri uri, string cacheName)
|
private static async Task<byte[]> LoadCachedBuffer(Tile tile, Uri uri, string cacheName)
|
||||||
{
|
{
|
||||||
byte[] buffer = null;
|
|
||||||
|
|
||||||
var extension = Path.GetExtension(uri.LocalPath);
|
var extension = Path.GetExtension(uri.LocalPath);
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(extension) || extension.Equals(".jpeg", StringComparison.OrdinalIgnoreCase))
|
if (string.IsNullOrEmpty(extension) || extension.Equals(".jpeg", StringComparison.OrdinalIgnoreCase))
|
||||||
|
|
@ -180,6 +178,7 @@ namespace MapControl
|
||||||
}
|
}
|
||||||
|
|
||||||
var cacheKey = $"{cacheName}/{tile.ZoomLevel}/{tile.Column}/{tile.Row}{extension}";
|
var cacheKey = $"{cacheName}/{tile.ZoomLevel}/{tile.Column}/{tile.Row}{extension}";
|
||||||
|
byte[] buffer = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue