XAML-Map-Control/MapControl/Avalonia/LocationAnimator.Avalonia.cs

13 lines
432 B
C#
Raw Normal View History

2025-02-27 18:46:32 +01:00
namespace MapControl
2024-05-20 23:24:34 +02:00
{
public class LocationAnimator : InterpolatingAnimator<Location>
{
public override Location Interpolate(double progress, Location oldValue, Location newValue)
{
2024-05-21 00:00:30 +02:00
return new Location(
(1d - progress) * oldValue.Latitude + progress * newValue.Latitude,
(1d - progress) * oldValue.Longitude + progress * newValue.Longitude);
2024-05-20 23:24:34 +02:00
}
}
}