mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Fixed panning for UWP/WinUI
This commit is contained in:
parent
2ac4985c47
commit
e2f4fc13b1
6 changed files with 128 additions and 30 deletions
|
|
@ -61,7 +61,7 @@ namespace MapControl
|
|||
#if WINUI
|
||||
private readonly DispatcherQueueTimer updateTimer;
|
||||
#else
|
||||
private readonly DispatcherTimer updateTimer = new DispatcherTimer();
|
||||
private readonly DispatcherTimer updateTimer;
|
||||
#endif
|
||||
private MapBase parentMap;
|
||||
|
||||
|
|
@ -69,10 +69,8 @@ namespace MapControl
|
|||
{
|
||||
RenderTransform = new MatrixTransform();
|
||||
TileImageLoader = tileImageLoader;
|
||||
#if WINUI
|
||||
updateTimer = DispatcherQueue.CreateTimer();
|
||||
#endif
|
||||
updateTimer.Interval = UpdateInterval;
|
||||
|
||||
updateTimer = this.CreateTimer(UpdateInterval);
|
||||
updateTimer.Tick += async (s, e) => await Update();
|
||||
|
||||
#if WINUI || UWP
|
||||
|
|
@ -172,7 +170,7 @@ namespace MapControl
|
|||
parentMap.ViewportChanged += OnViewportChanged;
|
||||
}
|
||||
|
||||
updateTimer.Start();
|
||||
updateTimer.Run();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -207,12 +205,7 @@ namespace MapControl
|
|||
{
|
||||
SetRenderTransform();
|
||||
|
||||
if (!UpdateWhileViewportChanging)
|
||||
{
|
||||
updateTimer.Stop(); // restart
|
||||
}
|
||||
|
||||
updateTimer.Start();
|
||||
updateTimer.Run(!UpdateWhileViewportChanging);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue