diff --git a/MapControl/Shared/BoundingBox.cs b/MapControl/Shared/BoundingBox.cs index 5d4ad5f2..4d5eecfd 100644 --- a/MapControl/Shared/BoundingBox.cs +++ b/MapControl/Shared/BoundingBox.cs @@ -38,7 +38,7 @@ namespace MapControl public virtual double Width => East - West; public virtual double Height => North - South; - public virtual Location Center => new Location((South + North) / 2d, (West + East) / 2d); + public virtual Location Center => new((South + North) / 2d, (West + East) / 2d); public override string ToString() { diff --git a/MapControl/Shared/GeoImage.cs b/MapControl/Shared/GeoImage.cs index 80e4f76c..240e7b3c 100644 --- a/MapControl/Shared/GeoImage.cs +++ b/MapControl/Shared/GeoImage.cs @@ -63,7 +63,7 @@ namespace MapControl private static string QueryString(ushort tag) => $"/ifd/{{ushort={tag}}}"; private static ILogger logger; - private static ILogger Logger => logger ??= ImageLoader.LoggerFactory?.CreateLogger(); + private static ILogger Logger => logger ??= ImageLoader.LoggerFactory?.CreateLogger(typeof(GeoImage)); public static readonly DependencyProperty SourcePathProperty = DependencyPropertyHelper.RegisterAttached("SourcePath", typeof(GeoImage), null, diff --git a/MapControl/Shared/GroundOverlay.cs b/MapControl/Shared/GroundOverlay.cs index d650c02d..bb325a9c 100644 --- a/MapControl/Shared/GroundOverlay.cs +++ b/MapControl/Shared/GroundOverlay.cs @@ -67,7 +67,7 @@ namespace MapControl } private static ILogger logger; - private static ILogger Logger => logger ??= ImageLoader.LoggerFactory?.CreateLogger(); + private static ILogger Logger => logger ??= ImageLoader.LoggerFactory?.CreateLogger(typeof(GroundOverlay)); public static readonly DependencyProperty SourcePathProperty = DependencyPropertyHelper.Register(nameof(SourcePath), null, diff --git a/MapControl/Shared/ImageFileCache.cs b/MapControl/Shared/ImageFileCache.cs index 9467db7d..22aaf78e 100644 --- a/MapControl/Shared/ImageFileCache.cs +++ b/MapControl/Shared/ImageFileCache.cs @@ -48,7 +48,7 @@ namespace MapControl.Caching rootDirectory = new DirectoryInfo(!string.IsNullOrEmpty(path) ? path : "TileCache"); rootDirectory.Create(); - logger = loggerFactory?.CreateLogger(); + logger = loggerFactory?.CreateLogger(typeof(ImageFileCache)); logger?.LogInformation("Started in {name}", rootDirectory.FullName); var memoryCacheOptions = new MemoryDistributedCacheOptions(); diff --git a/MapControl/Shared/ImageLoader.cs b/MapControl/Shared/ImageLoader.cs index 86e61efd..dc051064 100644 --- a/MapControl/Shared/ImageLoader.cs +++ b/MapControl/Shared/ImageLoader.cs @@ -16,7 +16,7 @@ namespace MapControl public static partial class ImageLoader { private static ILogger logger; - private static ILogger Logger => logger ??= ImageLoader.LoggerFactory?.CreateLogger(); + private static ILogger Logger => logger ??= ImageLoader.LoggerFactory?.CreateLogger(typeof(ImageLoader)); public static ILoggerFactory LoggerFactory { get; set; } diff --git a/MapControl/Shared/MapProjection.cs b/MapControl/Shared/MapProjection.cs index ca2b4989..e9d976f5 100644 --- a/MapControl/Shared/MapProjection.cs +++ b/MapControl/Shared/MapProjection.cs @@ -44,12 +44,12 @@ namespace MapControl /// /// Gets or sets an optional projection center. /// - public virtual Location Center { get; protected internal set; } = new Location(); + public virtual Location Center { get; protected internal set; } = new(); /// /// Gets the relative map scale at the specified Location. /// - public virtual Point GetRelativeScale(Location location) => new Point(1d, 1d); + public virtual Point GetRelativeScale(Location location) => new(1d, 1d); /// /// Transforms a Location in geographic coordinates to a Point in projected map coordinates. diff --git a/MapControl/Shared/TileImageLoader.cs b/MapControl/Shared/TileImageLoader.cs index 62e5a359..d91c13f8 100644 --- a/MapControl/Shared/TileImageLoader.cs +++ b/MapControl/Shared/TileImageLoader.cs @@ -23,7 +23,7 @@ namespace MapControl public class TileImageLoader : ITileImageLoader { private static ILogger logger; - private static ILogger Logger => logger ??= ImageLoader.LoggerFactory?.CreateLogger(); + private static ILogger Logger => logger ??= ImageLoader.LoggerFactory?.CreateLogger(typeof(TileImageLoader)); /// /// Default folder path where a persistent cache implementation may save data, i.e. "C:\ProgramData\MapControl\TileCache". diff --git a/MapControl/Shared/WmtsTileMatrixLayer.cs b/MapControl/Shared/WmtsTileMatrixLayer.cs index 3e20c123..621da874 100644 --- a/MapControl/Shared/WmtsTileMatrixLayer.cs +++ b/MapControl/Shared/WmtsTileMatrixLayer.cs @@ -35,7 +35,7 @@ namespace MapControl public TileMatrix TileMatrix { get; private set; } - public TileCollection Tiles { get; private set; } = new TileCollection(); + public TileCollection Tiles { get; private set; } = []; public void SetRenderTransform(ViewTransform viewTransform) {