sharee.bike-App/TINKLib/Model/Map/MapSpan.cs

31 lines
831 B
C#
Raw Normal View History

2022-01-22 18:16:10 +01:00
using System;
namespace TINK.Model.Map
{
/// <summary> Holds the displayed map area. </summary>
public class MapSpan : IMapSpan
{
internal MapSpan(IPosition center, double radius)
{
if (!GetIsValid(center, radius))
throw new ArgumentNullException();
Center = center;
Radius = radius;
}
/// <summary> Center of map displayed area.</summary>
public IPosition Center { get; }
/// <summary> Radius of displayed map area. </summary>
public double Radius { get; }
public bool IsValid => GetIsValid(Center, Radius);
public static bool GetIsValid(IPosition center, double radius)
2022-08-30 15:42:25 +02:00
=> center != null
&& center.IsValid
2022-01-22 18:16:10 +01:00
&& !double.IsNaN(radius);
}
}