Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 4.10.0: Updated target framework versions. Cleanup of TypeCon…
…verters, ImageLoader, MBTileSource.
- Loading branch information
1 parent
63a4c1f
commit 6a16530
Showing
36 changed files
with
266 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="System.Data.SQLite.Core" version="1.0.107.0" targetFramework="net45" /> | ||
<package id="System.Data.SQLite.Core" version="1.0.108.0" targetFramework="net47" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control | ||
// © 2018 Clemens Fischer | ||
// Licensed under the Microsoft Public License (Ms-PL) | ||
|
||
using System; | ||
using System.Diagnostics; | ||
using System.Threading.Tasks; | ||
#if WINDOWS_UWP | ||
using Windows.Web.Http; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Media.Imaging; | ||
#else | ||
using System.Net.Http; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
#endif | ||
|
||
namespace MapControl | ||
{ | ||
public static partial class ImageLoader | ||
{ | ||
/// <summary> | ||
/// The HttpClient instance used when image data is downloaded from a web resource. | ||
/// </summary> | ||
public static HttpClient HttpClient { get; set; } = new HttpClient(); | ||
|
||
public static async Task<ImageSource> LoadImageAsync(Uri uri, bool isTileImage) | ||
{ | ||
ImageSource imageSource = null; | ||
|
||
if (!uri.IsAbsoluteUri || uri.Scheme == "file") | ||
{ | ||
imageSource = await LoadLocalImageAsync(uri); | ||
} | ||
else if (uri.Scheme == "http") | ||
{ | ||
imageSource = await LoadHttpImageAsync(uri, isTileImage); | ||
} | ||
else | ||
{ | ||
imageSource = new BitmapImage(uri); | ||
} | ||
|
||
return imageSource; | ||
} | ||
|
||
public static async Task<ImageSource> LoadHttpImageAsync(Uri uri, bool isTileImage) | ||
{ | ||
ImageSource imageSource = null; | ||
|
||
using (var response = await HttpClient.GetAsync(uri)) | ||
{ | ||
if (!response.IsSuccessStatusCode) | ||
{ | ||
Debug.WriteLine("ImageLoader: {0}: {1} {2}", uri, (int)response.StatusCode, response.ReasonPhrase); | ||
} | ||
else if (!isTileImage || IsTileAvailable(response.Headers)) | ||
{ | ||
using (var stream = await GetResponseStreamAsync(response.Content)) | ||
{ | ||
imageSource = await CreateImageSourceAsync(stream); | ||
} | ||
} | ||
|
||
return imageSource; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.