Update MapBase.cs

This commit is contained in:
ClemensFischer 2024-08-30 10:27:59 +02:00
parent 5a3e711171
commit 2bf9b81fac

View file

@ -31,9 +31,11 @@ namespace MapControl
/// </summary> /// </summary>
public partial class MapBase : MapPanel public partial class MapBase : MapPanel
{ {
public static double ZoomLevelToScale(double zoomLevel) => 256d * Math.Pow(2d, zoomLevel) / (360d * MapProjection.Wgs84MeterPerDegree); public static double ZoomLevelToScale(double zoomLevel)
=> 256d * Math.Pow(2d, zoomLevel) / (360d * MapProjection.Wgs84MeterPerDegree);
public static double ScaleToZoomLevel(double scale) => Math.Log(scale * 360d * MapProjection.Wgs84MeterPerDegree / 256d, 2d); public static double ScaleToZoomLevel(double scale)
=> Math.Log(scale * 360d * MapProjection.Wgs84MeterPerDegree / 256d, 2d);
public static TimeSpan ImageFadeDuration { get; set; } = TimeSpan.FromSeconds(0.1); public static TimeSpan ImageFadeDuration { get; set; } = TimeSpan.FromSeconds(0.1);
@ -372,9 +374,8 @@ namespace MapControl
} }
} }
internal bool InsideViewport(Point point) => internal bool InsideViewport(Point point)
point.X >= 0d && point.X <= ActualWidth && => point.X >= 0d && point.Y >= 0d && point.X <= ActualWidth && point.Y <= ActualHeight;
point.Y >= 0d && point.Y <= ActualHeight;
internal double CoerceLongitude(double longitude) internal double CoerceLongitude(double longitude)
{ {