mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-16 15:16:34 +01:00
30 lines
693 B
C#
30 lines
693 B
C#
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)
|
|
=> center != null
|
|
&& center.IsValid
|
|
&& !double.IsNaN(radius);
|
|
}
|
|
}
|