Added LayerIdentifier to WmtsTileLayer cache path

This commit is contained in:
Clemens 2022-08-12 13:38:15 +02:00
parent 181c9e5642
commit 0af0901ce8
3 changed files with 19 additions and 16 deletions

View file

@ -174,12 +174,12 @@ namespace MapControl
if (!string.IsNullOrEmpty(cacheName))
{
cacheName += "/" + tileMatrixSet.Identifier
.Replace(':', '_')
.Replace(';', '_')
.Replace(',', '_')
.Replace('/', '_')
.Replace('\\', '_');
if (!string.IsNullOrEmpty(LayerIdentifier))
{
cacheName += "/" + LayerIdentifier.Replace(':', '_');
}
cacheName += "/" + tileMatrixSet.Identifier.Replace(':', '_');
}
}
@ -192,7 +192,7 @@ namespace MapControl
{
try
{
var capabilities = await WmtsCapabilities.ReadCapabilities(CapabilitiesUri, LayerIdentifier);
var capabilities = await WmtsCapabilities.ReadCapabilitiesAsync(CapabilitiesUri, LayerIdentifier);
foreach (var tileMatrixSet in capabilities.TileMatrixSets
.Where(s => !TileMatrixSets.ContainsKey(s.SupportedCrs)))