Reverted new() expressions

This commit is contained in:
ClemensFischer 2025-12-05 14:44:33 +01:00
parent 264f751d4e
commit 107b8e0f90
8 changed files with 52 additions and 23 deletions

View file

@ -38,7 +38,7 @@ namespace MapControl
public virtual double Width => East - West;
public virtual double Height => North - South;
public virtual Location Center => new((South + North) / 2d, (West + East) / 2d);
public virtual Location Center => new Location((South + North) / 2d, (West + East) / 2d);
public override string ToString()
{

View file

@ -174,7 +174,7 @@ namespace MapControl
/// Gets the ViewTransform instance that is used to transform between projected
/// map coordinates and view coordinates.
/// </summary>
public ViewTransform ViewTransform { get; } = new();
public ViewTransform ViewTransform { get; } = new ViewTransform();
/// <summary>
/// Gets the map scale as horizontal and vertical scaling factors from meters to

View file

@ -52,12 +52,12 @@ namespace MapControl
/// <summary>
/// Gets or sets an optional projection center.
/// </summary>
public virtual Location Center { get; protected internal set; } = new();
public virtual Location Center { get; protected internal set; } = new Location();
/// <summary>
/// Gets the relative map scale at the specified Location.
/// </summary>
public virtual Point GetRelativeScale(Location location) => new(1d, 1d);
public virtual Point GetRelativeScale(Location location) => new Point(1d, 1d);
/// <summary>
/// Transforms a Location in geographic coordinates to a Point in projected map coordinates.

View file

@ -55,9 +55,9 @@ namespace MapControl
set => SetValue(StrokeThicknessProperty, value);
}
private readonly Polyline line = new();
private readonly Polyline line = new Polyline();
private readonly TextBlock label = new()
private readonly TextBlock label = new TextBlock
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center

View file

@ -26,8 +26,8 @@ namespace MapControl
{
private const int tileSize = 256;
private static readonly Point mapTopLeft = new(-180d * MapProjection.Wgs84MeterPerDegree,
180d * MapProjection.Wgs84MeterPerDegree);
private static readonly Point mapTopLeft = new Point(-180d * MapProjection.Wgs84MeterPerDegree,
180d * MapProjection.Wgs84MeterPerDegree);
public static readonly DependencyProperty TileSourceProperty =
DependencyPropertyHelper.Register<MapTileLayer, TileSource>(nameof(TileSource), null,
@ -45,7 +45,7 @@ namespace MapControl
/// <summary>
/// A default MapTileLayer using OpenStreetMap data.
/// </summary>
public static MapTileLayer OpenStreetMapTileLayer => new()
public static MapTileLayer OpenStreetMapTileLayer => new MapTileLayer
{
TileSource = TileSource.Parse("https://tile.openstreetmap.org/{z}/{x}/{y}.png"),
SourceName = "OpenStreetMap",

View file

@ -70,7 +70,7 @@ namespace MapControl
/// </summary>
public static int MaxLoadTasks { get; set; } = 4;
private readonly Queue<Tile> tileQueue = new();
private readonly Queue<Tile> tileQueue = new Queue<Tile>();
private int tileCount;
private int taskCount;