mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-06 15:05:50 +00:00
Version 4: Upgrade to VS 2017
This commit is contained in:
parent
2aafe32e00
commit
ec47f225b3
142 changed files with 1828 additions and 18384 deletions
41
MapControl/Shared/Tile.cs
Normal file
41
MapControl/Shared/Tile.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
||||
// © 2017 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System;
|
||||
#if WINDOWS_UWP
|
||||
using Windows.UI.Xaml.Controls;
|
||||
#else
|
||||
using System.Windows.Controls;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
public partial class Tile
|
||||
{
|
||||
public static TimeSpan FadeDuration { get; set; } = TimeSpan.FromSeconds(0.1);
|
||||
|
||||
public readonly int ZoomLevel;
|
||||
public readonly int X;
|
||||
public readonly int Y;
|
||||
public readonly Image Image = new Image { Opacity = 0d };
|
||||
|
||||
public Tile(int zoomLevel, int x, int y)
|
||||
{
|
||||
ZoomLevel = zoomLevel;
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
|
||||
public bool Pending { get; set; } = true;
|
||||
|
||||
public int XIndex
|
||||
{
|
||||
get
|
||||
{
|
||||
var numTiles = 1 << ZoomLevel;
|
||||
return ((X % numTiles) + numTiles) % numTiles;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue