mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
52 lines
1.1 KiB
C#
52 lines
1.1 KiB
C#
// XAML Map Control - http://xamlmapcontrol.codeplex.com/
|
|
// Copyright © 2012 Clemens Fischer
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
using System;
|
|
#if WINRT
|
|
using Windows.UI.Xaml.Media.Animation;
|
|
#else
|
|
using System.Windows.Media.Animation;
|
|
#endif
|
|
|
|
namespace MapControl
|
|
{
|
|
internal partial class Tile
|
|
{
|
|
public readonly int ZoomLevel;
|
|
public readonly int X;
|
|
public readonly int Y;
|
|
|
|
public Tile(int zoomLevel, int x, int y)
|
|
{
|
|
ZoomLevel = zoomLevel;
|
|
X = x;
|
|
Y = y;
|
|
}
|
|
|
|
public Uri Uri { get; set; }
|
|
|
|
public int XIndex
|
|
{
|
|
get
|
|
{
|
|
var numTiles = 1 << ZoomLevel;
|
|
return ((X % numTiles) + numTiles) % numTiles;
|
|
}
|
|
}
|
|
|
|
DoubleAnimation OpacityAnimation
|
|
{
|
|
get
|
|
{
|
|
return new DoubleAnimation
|
|
{
|
|
To = 1d,
|
|
Duration = TimeSpan.FromSeconds(0.5),
|
|
FillBehavior = FillBehavior.HoldEnd,
|
|
};
|
|
}
|
|
}
|
|
}
|
|
}
|