mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Update MapTileLayerBase.cs
This commit is contained in:
parent
eaef66ebf0
commit
f54626ea21
|
|
@ -59,12 +59,7 @@ namespace MapControl
|
|||
TileImageLoader = tileImageLoader;
|
||||
|
||||
updateTimer = new DispatcherTimer { Interval = UpdateInterval };
|
||||
|
||||
updateTimer.Tick += (s, e) =>
|
||||
{
|
||||
updateTimer.Stop();
|
||||
UpdateTileLayer();
|
||||
};
|
||||
updateTimer.Tick += (s, e) => Update();
|
||||
|
||||
MapPanel.InitMapElement(this);
|
||||
}
|
||||
|
|
@ -149,8 +144,6 @@ namespace MapControl
|
|||
get { return parentMap; }
|
||||
set
|
||||
{
|
||||
updateTimer.Stop();
|
||||
|
||||
if (parentMap != null)
|
||||
{
|
||||
parentMap.ViewportChanged -= OnViewportChanged;
|
||||
|
|
@ -163,7 +156,7 @@ namespace MapControl
|
|||
parentMap.ViewportChanged += OnViewportChanged;
|
||||
}
|
||||
|
||||
UpdateTileLayer();
|
||||
Update();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -171,8 +164,7 @@ namespace MapControl
|
|||
{
|
||||
if (Children.Count == 0 || e.ProjectionChanged || Math.Abs(e.LongitudeOffset) > 180d)
|
||||
{
|
||||
updateTimer.Stop();
|
||||
UpdateTileLayer(); // update immediately when projection has changed or center has moved across 180° longitude
|
||||
Update(); // update immediately when projection has changed or center has moved across 180° longitude
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -190,6 +182,12 @@ namespace MapControl
|
|||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
updateTimer.Stop();
|
||||
UpdateTileLayer();
|
||||
}
|
||||
|
||||
protected abstract void UpdateTileLayer();
|
||||
|
||||
protected abstract void SetRenderTransform();
|
||||
|
|
|
|||
Loading…
Reference in a new issue