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
|
|
@ -73,16 +73,13 @@ namespace MapControl
|
|||
#if WINUI
|
||||
private readonly DispatcherQueueTimer updateTimer;
|
||||
#else
|
||||
private readonly DispatcherTimer updateTimer = new DispatcherTimer();
|
||||
private readonly DispatcherTimer updateTimer;
|
||||
#endif
|
||||
private bool updateInProgress;
|
||||
|
||||
public MapImageLayer()
|
||||
{
|
||||
#if WINUI
|
||||
updateTimer = DispatcherQueue.CreateTimer();
|
||||
#endif
|
||||
updateTimer.Interval = UpdateInterval;
|
||||
updateTimer = this.CreateTimer(UpdateInterval);
|
||||
updateTimer.Tick += async (s, e) => await UpdateImageAsync();
|
||||
}
|
||||
|
||||
|
|
@ -227,12 +224,7 @@ namespace MapControl
|
|||
|
||||
base.OnViewportChanged(e);
|
||||
|
||||
if (!UpdateWhileViewportChanging)
|
||||
{
|
||||
updateTimer.Stop(); // restart
|
||||
}
|
||||
|
||||
updateTimer.Start();
|
||||
updateTimer.Run(!UpdateWhileViewportChanging);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -242,7 +234,7 @@ namespace MapControl
|
|||
|
||||
if (updateInProgress)
|
||||
{
|
||||
updateTimer.Start(); // update image on next timer tick
|
||||
updateTimer.Run(); // update image on next timer tick
|
||||
}
|
||||
else if (ParentMap != null && ParentMap.RenderSize.Width > 0 && ParentMap.RenderSize.Height > 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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