mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-06 06:55:04 +00:00
Reworked MapPath and derived classes
This commit is contained in:
parent
414389513e
commit
49d508b3f5
9 changed files with 106 additions and 84 deletions
|
|
@ -84,7 +84,7 @@ namespace MapControl
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Normalizes a longitude to a value in the interval [-180..180].
|
||||
/// Normalizes a longitude to a value in the interval [-180 .. 180].
|
||||
/// </summary>
|
||||
public static double NormalizeLongitude(double longitude)
|
||||
{
|
||||
|
|
@ -99,21 +99,5 @@ namespace MapControl
|
|||
|
||||
return longitude;
|
||||
}
|
||||
|
||||
internal static double NearestLongitude(double longitude, double referenceLongitude)
|
||||
{
|
||||
longitude = NormalizeLongitude(longitude);
|
||||
|
||||
if (longitude > referenceLongitude + 180d)
|
||||
{
|
||||
longitude -= 360d;
|
||||
}
|
||||
else if (longitude < referenceLongitude - 180d)
|
||||
{
|
||||
longitude += 360d;
|
||||
}
|
||||
|
||||
return longitude;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue