mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-08 16:05:50 +00:00
Fixed TileSource (14.2.0)
This commit is contained in:
parent
ef7849948e
commit
36883a8d9d
6 changed files with 49 additions and 20 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Security.Policy;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
#if WPF
|
||||
|
|
@ -14,7 +15,7 @@ using ImageSource = Avalonia.Media.IImage;
|
|||
namespace MapControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides the download Uri or ImageSource of map tiles.
|
||||
/// Provides the download Uri or ImageSource of map tiles. Used by TileImageLoader.
|
||||
/// </summary>
|
||||
#if UWP || WINUI
|
||||
[Windows.Foundation.Metadata.CreateFromString(MethodName = "Parse")]
|
||||
|
|
@ -24,15 +25,38 @@ namespace MapControl
|
|||
public class TileSource
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the image request Uri for the specified zoom level and tile indices.
|
||||
/// May return null when the image shall be loaded by the LoadImageAsync method.
|
||||
/// Gets an image request Uri for the specified zoom level and tile indices.
|
||||
/// May return null when the image shall be loaded by
|
||||
/// the LoadImageAsync(zoomLevel, column, row) method.
|
||||
/// </summary>
|
||||
public virtual Uri GetUri(int zoomLevel, int column, int row) => null;
|
||||
public virtual Uri GetUri(int zoomLevel, int column, int row)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads a tile image without an Uri.
|
||||
/// </summary>
|
||||
public virtual Task<ImageSource> LoadImageAsync(int zoomLevel, int column, int row) => null;
|
||||
public virtual Task<ImageSource> LoadImageAsync(int zoomLevel, int column, int row)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads a tile image from an Uri.
|
||||
/// </summary>
|
||||
public virtual Task<ImageSource> LoadImageAsync(Uri uri)
|
||||
{
|
||||
return ImageLoader.LoadImageAsync(uri);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads a tile image from an encoded frame buffer.
|
||||
/// </summary>
|
||||
public virtual Task<ImageSource> LoadImageAsync(byte[] buffer)
|
||||
{
|
||||
return ImageLoader.LoadImageAsync(buffer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a TileSource instance from an Uri template string.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue