TilePyramidLayer overrides

This commit is contained in:
ClemensFischer 2025-11-23 17:29:30 +01:00
parent eebf17e6fe
commit 8c53587643
2 changed files with 22 additions and 22 deletions

View file

@ -115,6 +115,20 @@ namespace MapControl
return finalSize;
}
protected override void UpdateRenderTransform()
{
if (TileMatrix != null)
{
// Tile matrix origin in pixels.
//
var tileMatrixOrigin = new Point(TileSize * TileMatrix.XMin, TileSize * TileMatrix.YMin);
var tileMatrixScale = MapBase.ZoomLevelToScale(TileMatrix.ZoomLevel);
((MatrixTransform)RenderTransform).Matrix =
ParentMap.ViewTransform.GetTileLayerTransform(tileMatrixScale, MapTopLeft, tileMatrixOrigin);
}
}
protected override void UpdateTileCollection(bool reset)
{
if (ParentMap == null || !SupportedCrsIds.Contains(ParentMap.MapProjection.CrsId))
@ -132,20 +146,6 @@ namespace MapControl
}
}
protected override void UpdateRenderTransform()
{
if (TileMatrix != null)
{
// Tile matrix origin in pixels.
//
var tileMatrixOrigin = new Point(TileSize * TileMatrix.XMin, TileSize * TileMatrix.YMin);
var tileMatrixScale = MapBase.ZoomLevelToScale(TileMatrix.ZoomLevel);
((MatrixTransform)RenderTransform).Matrix =
ParentMap.ViewTransform.GetTileLayerTransform(tileMatrixScale, MapTopLeft, tileMatrixOrigin);
}
}
private bool SetTileMatrix()
{
// Add 0.001 to avoid rounding issues.

View file

@ -100,6 +100,14 @@ namespace MapControl
return finalSize;
}
protected override void UpdateRenderTransform()
{
foreach (var layer in ChildLayers)
{
layer.UpdateRenderTransform(ParentMap.ViewTransform);
}
}
protected override void UpdateTileCollection(bool reset)
{
// reset parameter is ignored here because it is always false.
@ -133,14 +141,6 @@ namespace MapControl
}
}
protected override void UpdateRenderTransform()
{
foreach (var layer in ChildLayers)
{
layer.UpdateRenderTransform(ParentMap.ViewTransform);
}
}
private bool UpdateChildLayers(WmtsTileMatrixSet tileMatrixSet)
{
// Multiply scale by 1.001 to avoid rounding issues.