mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-06 06:55:04 +00:00
Version 4.10.0: Improved ImageLoader and MBTiles.
This commit is contained in:
parent
eca9178971
commit
bdcd2597a1
13 changed files with 403 additions and 339 deletions
|
|
@ -51,27 +51,20 @@ namespace MapControl
|
|||
return imageSource;
|
||||
}
|
||||
|
||||
public static async Task<ImageSource> LoadHttpImageAsync(Uri uri)
|
||||
private static async Task<ImageSource> LoadHttpImageAsync(Uri uri)
|
||||
{
|
||||
ImageSource imageSource = null;
|
||||
|
||||
try
|
||||
using (var response = await HttpClient.GetAsync(uri))
|
||||
{
|
||||
using (var response = await HttpClient.GetAsync(uri))
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
Debug.WriteLine("ImageLoader: {0}: {1} {2}", uri, (int)response.StatusCode, response.ReasonPhrase);
|
||||
}
|
||||
else if (IsTileAvailable(response.Headers))
|
||||
{
|
||||
imageSource = await CreateImageSourceAsync(response.Content);
|
||||
}
|
||||
Debug.WriteLine("ImageLoader: {0}: {1} {2}", uri, (int)response.StatusCode, response.ReasonPhrase);
|
||||
}
|
||||
else if (IsTileAvailable(response.Headers))
|
||||
{
|
||||
imageSource = await CreateImageSourceAsync(response.Content);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine("ImageLoader: {0}: {1}", uri, ex.Message);
|
||||
}
|
||||
|
||||
return imageSource;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue