mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Minor improvements
This commit is contained in:
parent
e0eb50b7da
commit
24dabf046d
|
|
@ -177,7 +177,7 @@ namespace MapControl
|
|||
{
|
||||
availableSize = new Size(double.PositiveInfinity, double.PositiveInfinity);
|
||||
|
||||
foreach (var element in Children.OfType<FrameworkElement>())
|
||||
foreach (var element in Children.Cast<FrameworkElement>())
|
||||
{
|
||||
element.Measure(availableSize);
|
||||
}
|
||||
|
|
@ -189,7 +189,7 @@ namespace MapControl
|
|||
{
|
||||
if (parentMap != null)
|
||||
{
|
||||
foreach (var element in Children.OfType<FrameworkElement>())
|
||||
foreach (var element in Children.Cast<FrameworkElement>())
|
||||
{
|
||||
ArrangeChildElement(element, finalSize);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,8 +98,6 @@ namespace MapControl
|
|||
}
|
||||
|
||||
protected override Size ArrangeOverride(Size finalSize)
|
||||
{
|
||||
if (TileMatrix != null)
|
||||
{
|
||||
foreach (var tile in Tiles)
|
||||
{
|
||||
|
|
@ -113,7 +111,6 @@ namespace MapControl
|
|||
tile.Image.Height = tileSize;
|
||||
tile.Image.Arrange(new Rect(x, y, tileSize, tileSize));
|
||||
}
|
||||
}
|
||||
|
||||
return finalSize;
|
||||
}
|
||||
|
|
@ -122,9 +119,10 @@ namespace MapControl
|
|||
{
|
||||
if (ParentMap == null || !SupportedCrsIds.Contains(ParentMap.MapProjection.CrsId))
|
||||
{
|
||||
TileMatrix = null;
|
||||
Children.Clear();
|
||||
CancelLoadTiles();
|
||||
Children.Clear();
|
||||
Tiles.Clear();
|
||||
TileMatrix = null;
|
||||
}
|
||||
else if (SetTileMatrix() || reset)
|
||||
{
|
||||
|
|
@ -183,8 +181,6 @@ namespace MapControl
|
|||
{
|
||||
var tiles = new ImageTileList();
|
||||
|
||||
if (TileSource != null && TileMatrix != null)
|
||||
{
|
||||
if (reset)
|
||||
{
|
||||
Tiles.Clear();
|
||||
|
|
@ -213,9 +209,9 @@ namespace MapControl
|
|||
tiles.FillMatrix(Tiles, zoomLevel, xMin, yMin, xMax, yMax, tileCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Tiles = tiles;
|
||||
|
||||
Children.Clear();
|
||||
|
||||
foreach (var tile in tiles)
|
||||
|
|
|
|||
|
|
@ -23,11 +23,11 @@ namespace MapControl
|
|||
{
|
||||
// zoomLevel is index of tileMatrix in a WmtsTileMatrixSet.TileMatrixes list.
|
||||
//
|
||||
public WmtsTileMatrixLayer(WmtsTileMatrix tileMatrix, int zoomLevel)
|
||||
public WmtsTileMatrixLayer(WmtsTileMatrix wmtsTileMatrix, int zoomLevel)
|
||||
{
|
||||
MapPanel.SetRenderTransform(this, new MatrixTransform());
|
||||
|
||||
WmtsTileMatrix = tileMatrix;
|
||||
WmtsTileMatrix = wmtsTileMatrix;
|
||||
TileMatrix = new TileMatrix(zoomLevel, 1, 1, 0, 0);
|
||||
}
|
||||
|
||||
|
|
@ -87,8 +87,8 @@ namespace MapControl
|
|||
|
||||
var tiles = new ImageTileList();
|
||||
tiles.FillMatrix(Tiles, TileMatrix.ZoomLevel, xMin, yMin, xMax, yMax, WmtsTileMatrix.MatrixWidth);
|
||||
|
||||
Tiles = tiles;
|
||||
|
||||
Children.Clear();
|
||||
|
||||
foreach (var tile in tiles)
|
||||
|
|
|
|||
Loading…
Reference in a new issue