Location equality

This commit is contained in:
ClemensFischer 2026-01-25 11:57:14 +01:00
parent 1e13a3bffb
commit 7208cc71bd
9 changed files with 50 additions and 30 deletions

View file

@ -71,7 +71,10 @@ namespace MapControl
if (value != null)
{
SetCenter(value);
var longitude = Location.NormalizeLongitude(value.Longitude);
SetCenter(value.LongitudeEquals(longitude) ? value : new Location(value.Latitude, longitude));
updateCenter = false;
}
}
@ -89,12 +92,9 @@ namespace MapControl
{
if (updateCenter)
{
var latitude = value.Latitude;
var longitude = Location.NormalizeLongitude(value.Longitude);
if (center == null || !center.Equals(latitude, longitude))
if (center == null || !center.Equals(value))
{
center = new Location(latitude, longitude);
center = value;
CenterChanged();
}
}