mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Version 4.10.0: Updated target framework versions. Cleanup of TypeConverters, ImageLoader, MBTileSource.
This commit is contained in:
parent
6a1653056f
commit
acf43d70ea
8 changed files with 109 additions and 81 deletions
|
|
@ -24,7 +24,7 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public static HttpClient HttpClient { get; set; } = new HttpClient();
|
||||
|
||||
public static async Task<ImageSource> LoadImageAsync(Uri uri, bool isTileImage)
|
||||
public static async Task<ImageSource> LoadImageAsync(Uri uri)
|
||||
{
|
||||
ImageSource imageSource = null;
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ namespace MapControl
|
|||
}
|
||||
else if (uri.Scheme == "http")
|
||||
{
|
||||
imageSource = await LoadHttpImageAsync(uri, isTileImage);
|
||||
imageSource = await LoadHttpImageAsync(uri);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -44,7 +44,7 @@ namespace MapControl
|
|||
return imageSource;
|
||||
}
|
||||
|
||||
public static async Task<ImageSource> LoadHttpImageAsync(Uri uri, bool isTileImage)
|
||||
public static async Task<ImageSource> LoadHttpImageAsync(Uri uri)
|
||||
{
|
||||
ImageSource imageSource = null;
|
||||
|
||||
|
|
@ -54,12 +54,9 @@ namespace MapControl
|
|||
{
|
||||
Debug.WriteLine("ImageLoader: {0}: {1} {2}", uri, (int)response.StatusCode, response.ReasonPhrase);
|
||||
}
|
||||
else if (!isTileImage || IsTileAvailable(response.Headers))
|
||||
else if (IsTileAvailable(response.Headers))
|
||||
{
|
||||
using (var stream = await GetResponseStreamAsync(response.Content))
|
||||
{
|
||||
imageSource = await CreateImageSourceAsync(stream);
|
||||
}
|
||||
imageSource = await CreateImageSourceAsync(response.Content);
|
||||
}
|
||||
|
||||
return imageSource;
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ namespace MapControl
|
|||
{
|
||||
try
|
||||
{
|
||||
imageSource = await ImageLoader.LoadImageAsync(uri, true);
|
||||
imageSource = await ImageLoader.LoadImageAsync(uri);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ namespace MapControl
|
|||
|
||||
try
|
||||
{
|
||||
imageSource = await ImageLoader.LoadImageAsync(new Uri(uri.Replace(" ", "%20")), false);
|
||||
imageSource = await ImageLoader.LoadImageAsync(new Uri(uri.Replace(" ", "%20")));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue