Updated NearestLongitude

This commit is contained in:
ClemensFischer 2026-01-29 17:04:12 +01:00
parent 8233273779
commit 45b47bbae4
2 changed files with 4 additions and 2 deletions

View file

@ -313,6 +313,8 @@ namespace MapControl
internal double NearestLongitude(double longitude)
{
longitude = Location.NormalizeLongitude(longitude);
var offset = longitude - Center.Longitude;
if (offset > 180d)

View file

@ -224,7 +224,7 @@ namespace MapControl
{
var longitude = parentMap.NearestLongitude(location.Longitude);
if (longitude != location.Longitude)
if (!location.LongitudeEquals(longitude))
{
position = parentMap.LocationToView(location.Latitude, longitude);
}
@ -243,7 +243,7 @@ namespace MapControl
var location = parentMap.MapProjection.MapToLocation(center);
var longitude = parentMap.NearestLongitude(location.Longitude);
if (longitude != location.Longitude)
if (!location.LongitudeEquals(longitude))
{
position = parentMap.LocationToView(location.Latitude, longitude);
}