MapPanel, MapPath location coercion

This commit is contained in:
ClemensFischer 2024-08-30 10:02:27 +02:00
parent 27729bf06c
commit 5a3e711171
2 changed files with 3 additions and 9 deletions

View file

@ -86,13 +86,7 @@ namespace MapControl
if (position.HasValue && !parentMap.InsideViewport(position.Value))
{
var coercedLongitude = parentMap.CoerceLongitude(location.Longitude);
var coercedPosition = parentMap.LocationToView(new Location(location.Latitude, coercedLongitude));
if (coercedPosition.HasValue && parentMap.InsideViewport(coercedPosition.Value))
{
longitudeOffset = coercedLongitude - location.Longitude;
}
longitudeOffset = parentMap.CoerceLongitude(location.Longitude) - location.Longitude;
}
}