mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Updated WmtsTileMatrixSet
This commit is contained in:
parent
ab1695b107
commit
baea814df0
|
|
@ -13,6 +13,13 @@ using Avalonia;
|
||||||
|
|
||||||
namespace MapControl
|
namespace MapControl
|
||||||
{
|
{
|
||||||
|
public class WmtsTileMatrixSet(string identifier, string supportedCrsId, IEnumerable<WmtsTileMatrix> tileMatrixes)
|
||||||
|
{
|
||||||
|
public string Identifier => identifier;
|
||||||
|
public string SupportedCrsId => supportedCrsId;
|
||||||
|
public List<WmtsTileMatrix> TileMatrixes { get; } = tileMatrixes.OrderBy(m => m.Scale).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For reference see https://www.ogc.org/standards/wmts, 07-057r7_Web_Map_Tile_Service_Standard.pdf
|
/// For reference see https://www.ogc.org/standards/wmts, 07-057r7_Web_Map_Tile_Service_Standard.pdf
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -217,6 +217,9 @@ namespace MapControl
|
||||||
{
|
{
|
||||||
var capabilities = await WmtsCapabilities.ReadCapabilitiesAsync(CapabilitiesUri, Layer);
|
var capabilities = await WmtsCapabilities.ReadCapabilitiesAsync(CapabilitiesUri, Layer);
|
||||||
|
|
||||||
|
Layer = capabilities.Layer;
|
||||||
|
UriTemplate = capabilities.UriTemplate;
|
||||||
|
|
||||||
foreach (var tms in capabilities.TileMatrixSets
|
foreach (var tms in capabilities.TileMatrixSets
|
||||||
.Where(tms => !TileMatrixSets.ContainsKey(tms.SupportedCrsId) ||
|
.Where(tms => !TileMatrixSets.ContainsKey(tms.SupportedCrsId) ||
|
||||||
PreferredTileMatrixSets != null &&
|
PreferredTileMatrixSets != null &&
|
||||||
|
|
@ -225,9 +228,6 @@ namespace MapControl
|
||||||
TileMatrixSets[tms.SupportedCrsId] = tms;
|
TileMatrixSets[tms.SupportedCrsId] = tms;
|
||||||
}
|
}
|
||||||
|
|
||||||
Layer = capabilities.Layer;
|
|
||||||
UriTemplate = capabilities.UriTemplate;
|
|
||||||
|
|
||||||
UpdateTileCollection();
|
UpdateTileCollection();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace MapControl
|
|
||||||
{
|
|
||||||
public class WmtsTileMatrixSet
|
|
||||||
{
|
|
||||||
public WmtsTileMatrixSet(string identifier, string supportedCrsId, IEnumerable<WmtsTileMatrix> tileMatrixes)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(supportedCrsId))
|
|
||||||
{
|
|
||||||
throw new ArgumentException($"The {nameof(supportedCrsId)} argument must not be null or empty.", nameof(supportedCrsId));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tileMatrixes == null || !tileMatrixes.Any())
|
|
||||||
{
|
|
||||||
throw new ArgumentException($"The {nameof(tileMatrixes)} argument must not be null or an empty collection.", nameof(tileMatrixes));
|
|
||||||
}
|
|
||||||
|
|
||||||
Identifier = identifier;
|
|
||||||
SupportedCrsId = supportedCrsId;
|
|
||||||
TileMatrixes = tileMatrixes.OrderBy(m => m.Scale).ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Identifier { get; }
|
|
||||||
public string SupportedCrsId { get; }
|
|
||||||
public IList<WmtsTileMatrix> TileMatrixes { get; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue