mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Updated MapTileLayer
This commit is contained in:
parent
6435ee462a
commit
8eb3c072f5
|
|
@ -204,15 +204,12 @@ namespace MapControl
|
|||
|
||||
base.OnViewportChanged(e);
|
||||
|
||||
if (updateTimer.IsEnabled && !UpdateWhileViewportChanging)
|
||||
if (!UpdateWhileViewportChanging)
|
||||
{
|
||||
updateTimer.Stop(); // restart
|
||||
}
|
||||
|
||||
if (!updateTimer.IsEnabled)
|
||||
{
|
||||
updateTimer.Start();
|
||||
}
|
||||
updateTimer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,29 +82,30 @@ namespace MapControl
|
|||
|
||||
protected override void UpdateTileLayer(bool tileSourceChanged)
|
||||
{
|
||||
var update = false;
|
||||
var updateTiles = false;
|
||||
|
||||
if (ParentMap == null || !ParentMap.MapProjection.IsWebMercator)
|
||||
{
|
||||
Tiles.Clear();
|
||||
TileMatrix = null;
|
||||
update = true;
|
||||
updateTiles = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tileSourceChanged)
|
||||
{
|
||||
Tiles.Clear();
|
||||
update = true;
|
||||
updateTiles = true;
|
||||
}
|
||||
|
||||
if (SetTileMatrix())
|
||||
{
|
||||
SetRenderTransform();
|
||||
update = true;
|
||||
updateTiles = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (update)
|
||||
if (updateTiles)
|
||||
{
|
||||
UpdateTiles();
|
||||
}
|
||||
|
|
@ -154,10 +155,9 @@ namespace MapControl
|
|||
|
||||
private void UpdateTiles()
|
||||
{
|
||||
var newTiles = new List<Tile>();
|
||||
|
||||
if (ParentMap != null && TileMatrix != null && TileSource != null)
|
||||
{
|
||||
var newTiles = new List<Tile>();
|
||||
var maxZoomLevel = Math.Min(TileMatrix.ZoomLevel, MaxZoomLevel);
|
||||
|
||||
if (maxZoomLevel >= MinZoomLevel)
|
||||
|
|
@ -201,9 +201,9 @@ namespace MapControl
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Tiles = newTiles;
|
||||
Tiles = newTiles;
|
||||
}
|
||||
|
||||
Children.Clear();
|
||||
|
||||
|
|
|
|||
|
|
@ -170,15 +170,12 @@ namespace MapControl
|
|||
{
|
||||
SetRenderTransform();
|
||||
|
||||
if (updateTimer.IsEnabled && !UpdateWhileViewportChanging)
|
||||
if (!UpdateWhileViewportChanging)
|
||||
{
|
||||
updateTimer.Stop(); // restart
|
||||
}
|
||||
|
||||
if (!updateTimer.IsEnabled)
|
||||
{
|
||||
updateTimer.Start();
|
||||
}
|
||||
updateTimer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue