Updated TileImageLoader

This commit is contained in:
ClemensFischer 2025-12-25 23:53:49 +01:00
parent 3c991d691b
commit 2961836792
6 changed files with 10 additions and 8 deletions

View file

@ -163,7 +163,7 @@ namespace MapControl
{
await tile.LoadImageAsync(() => tileSource.LoadImageAsync(tile.ZoomLevel, tile.Column, tile.Row)).ConfigureAwait(false);
}
else if (uri.Scheme != "http" && uri.Scheme != "https" || string.IsNullOrEmpty(cacheName))
else if (uri.Scheme != Uri.UriSchemeHttps && uri.Scheme != Uri.UriSchemeHttp || string.IsNullOrEmpty(cacheName))
{
await tile.LoadImageAsync(() => tileSource.LoadImageAsync(uri)).ConfigureAwait(false);
}

View file

@ -33,7 +33,7 @@ namespace MapControl
}
/// <summary>
/// Loads a tile image without an Uri.
/// Loads a tile image without an Uri. Called when GetUri returns null.
/// </summary>
public virtual Task<ImageSource> LoadImageAsync(int zoomLevel, int column, int row)
{
@ -41,7 +41,8 @@ namespace MapControl
}
/// <summary>
/// Loads a tile image from an Uri.
/// Loads a tile image from an Uri. Called when the Uri scheme is neither
/// http nor https or when the TileImageLoader is not using an image cache.
/// </summary>
public virtual Task<ImageSource> LoadImageAsync(Uri uri)
{
@ -49,7 +50,8 @@ namespace MapControl
}
/// <summary>
/// Loads a tile image from an encoded frame buffer.
/// Loads a tile image from an encoded image buffer. Called when the
/// TileImageLoader caches image buffers from http or https requests.
/// </summary>
public virtual Task<ImageSource> LoadImageAsync(byte[] buffer)
{

View file

@ -131,7 +131,7 @@
</tools:MapLayerMenuItem>
<tools:MapLayerMenuItem Text="OpenStreetMap French">
<map:MapTileLayer
TileSource="http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png"
TileSource="https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png"
SourceName="OpenStreetMap French"
Description="© [OpenStreetMap France](https://www.openstreetmap.fr/mentions-legales/) © [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)"/>
</tools:MapLayerMenuItem>

View file

@ -187,7 +187,7 @@
</tools:MapLayerMenuItem>
<tools:MapLayerMenuItem Text="OpenStreetMap French">
<map:MapTileLayer
TileSource="http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png"
TileSource="https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png"
SourceName="OpenStreetMap French"
Description="© [OpenStreetMap France](https://www.openstreetmap.fr/mentions-legales/) © [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)"/>
</tools:MapLayerMenuItem>

View file

@ -212,7 +212,7 @@
</tools:MapLayerMenuItem>
<tools:MapLayerMenuItem Text="OpenStreetMap French">
<map:MapTileLayer
TileSource="http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png"
TileSource="https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png"
SourceName="OpenStreetMap French"
Description="© [OpenStreetMap France](https://www.openstreetmap.fr/mentions-legales/) © [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)"/>
</tools:MapLayerMenuItem>

View file

@ -189,7 +189,7 @@
</tools:MapLayerMenuItem>
<tools:MapLayerMenuItem Text="OpenStreetMap French">
<map:MapTileLayer
TileSource="http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png"
TileSource="https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png"
SourceName="OpenStreetMap French"
Description="© [OpenStreetMap France](https://www.openstreetmap.fr/mentions-legales/) © [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)"/>
</tools:MapLayerMenuItem>