mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-07 23:45:05 +00:00
Location equality
This commit is contained in:
parent
1e13a3bffb
commit
7208cc71bd
9 changed files with 50 additions and 30 deletions
|
|
@ -35,7 +35,11 @@ namespace MapControl
|
|||
public double Latitude { get; }
|
||||
public double Longitude { get; }
|
||||
|
||||
public bool Equals(double latitude, double longitude) => Latitude == latitude && Longitude == longitude;
|
||||
public bool LatitudeEquals(double latitude) => Math.Abs(Latitude - latitude) < 1e-9;
|
||||
|
||||
public bool LongitudeEquals(double longitude) => Math.Abs(Longitude - longitude) < 1e-9;
|
||||
|
||||
public bool Equals(double latitude, double longitude) => LatitudeEquals(latitude) && LongitudeEquals(longitude);
|
||||
|
||||
public bool Equals(Location location) => location != null && Equals(location.Latitude, location.Longitude);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue