Fixed TileSource (14.2.0)

This commit is contained in:
ClemensFischer 2025-11-14 15:02:48 +01:00
parent ef7849948e
commit 36883a8d9d
6 changed files with 49 additions and 20 deletions

View file

@ -24,6 +24,11 @@ namespace MapControl
/// </summary>
public partial class MapTileLayer : TilePyramidLayer
{
private const int TileSize = 256;
private static readonly Point MapTopLeft = new(-180d * MapProjection.Wgs84MeterPerDegree,
180d * MapProjection.Wgs84MeterPerDegree);
public static readonly DependencyProperty MinZoomLevelProperty =
DependencyPropertyHelper.Register<MapTileLayer, int>(nameof(MinZoomLevel), 0);
@ -33,11 +38,6 @@ namespace MapControl
public static readonly DependencyProperty ZoomLevelOffsetProperty =
DependencyPropertyHelper.Register<MapTileLayer, double>(nameof(ZoomLevelOffset), 0d);
private const int TileSize = 256;
private static readonly Point MapTopLeft = new(-180d * MapProjection.Wgs84MeterPerDegree,
180d * MapProjection.Wgs84MeterPerDegree);
/// <summary>
/// A default MapTileLayer using OpenStreetMap data.
/// </summary>
@ -48,6 +48,11 @@ namespace MapControl
Description = "© [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)"
};
public MapTileLayer()
{
MapPanel.SetRenderTransform(this, new MatrixTransform());
}
public override IReadOnlyCollection<string> SupportedCrsIds { get; } = [WebMercatorProjection.DefaultCrsId];
public TileMatrix TileMatrix { get; private set; }