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

14 lines
421 B
C#
Raw Normal View History

2025-08-19 19:43:02 +02:00
using Avalonia.Animation;
2026-04-13 17:14:49 +02:00
namespace MapControl;
public class LocationAnimator : InterpolatingAnimator<Location>
2024-05-20 23:24:34 +02:00
{
2026-04-13 17:14:49 +02:00
public override Location Interpolate(double progress, Location oldValue, Location newValue)
2024-05-20 23:24:34 +02:00
{
2026-04-13 17:14:49 +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
}
}