Update WmtsTileLayer.cs

This commit is contained in:
ClemensFischer 2025-01-17 08:25:26 +01:00
parent dd738c85a4
commit 1fde5e322e

View file

@ -106,21 +106,18 @@ namespace MapControl
}
else if (UpdateChildLayers(tileMatrixSet))
{
((WmtsTileSource)TileSource).TileMatrixSet = tileMatrixSet;
var cacheName = SourceName;
if (TileSource is WmtsTileSource tileSource)
if (!string.IsNullOrEmpty(cacheName))
{
tileSource.TileMatrixSet = tileMatrixSet;
if (!string.IsNullOrEmpty(cacheName))
if (!string.IsNullOrEmpty(Layer))
{
if (!string.IsNullOrEmpty(Layer))
{
cacheName += "/" + Layer.Replace(':', '_');
}
cacheName += "/" + tileMatrixSet.Identifier.Replace(':', '_');
cacheName += "/" + Layer.Replace(':', '_');
}
cacheName += "/" + tileMatrixSet.Identifier.Replace(':', '_');
}
var tiles = ChildLayers.SelectMany(layer => layer.Tiles);