2012-11-22 21:42:29 +01:00
|
|
|
|
// XAML Map Control - http://xamlmapcontrol.codeplex.com/
|
2012-05-04 12:52:20 +02:00
|
|
|
|
// Copyright © 2012 Clemens Fischer
|
|
|
|
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
2012-11-22 21:42:29 +01:00
|
|
|
|
#if WINRT
|
|
|
|
|
|
using Windows.UI.Xaml.Media.Animation;
|
|
|
|
|
|
#else
|
2012-04-25 22:02:53 +02:00
|
|
|
|
using System.Windows.Media.Animation;
|
2012-11-22 21:42:29 +01:00
|
|
|
|
#endif
|
2012-04-25 22:02:53 +02:00
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
2012-11-22 21:42:29 +01:00
|
|
|
|
internal partial class Tile
|
2012-04-25 22:02:53 +02:00
|
|
|
|
{
|
|
|
|
|
|
public readonly int ZoomLevel;
|
|
|
|
|
|
public readonly int X;
|
|
|
|
|
|
public readonly int Y;
|
|
|
|
|
|
|
2012-06-18 20:12:35 +02:00
|
|
|
|
public Tile(int zoomLevel, int x, int y)
|
2012-04-25 22:02:53 +02:00
|
|
|
|
{
|
|
|
|
|
|
ZoomLevel = zoomLevel;
|
|
|
|
|
|
X = x;
|
|
|
|
|
|
Y = y;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2012-06-18 20:12:35 +02:00
|
|
|
|
public Uri Uri { get; set; }
|
2012-04-25 22:02:53 +02:00
|
|
|
|
|
|
|
|
|
|
public int XIndex
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2012-11-22 21:42:29 +01:00
|
|
|
|
var numTiles = 1 << ZoomLevel;
|
2012-04-25 22:02:53 +02:00
|
|
|
|
return ((X % numTiles) + numTiles) % numTiles;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2012-11-22 21:42:29 +01:00
|
|
|
|
DoubleAnimation OpacityAnimation
|
2012-11-06 19:49:29 +01:00
|
|
|
|
{
|
2012-11-22 21:42:29 +01:00
|
|
|
|
get
|
2012-04-25 22:02:53 +02:00
|
|
|
|
{
|
2012-11-22 21:42:29 +01:00
|
|
|
|
return new DoubleAnimation
|
2012-11-06 19:49:29 +01:00
|
|
|
|
{
|
2012-11-22 21:42:29 +01:00
|
|
|
|
To = 1d,
|
|
|
|
|
|
Duration = TimeSpan.FromSeconds(0.5),
|
|
|
|
|
|
FillBehavior = FillBehavior.HoldEnd,
|
|
|
|
|
|
};
|
2012-04-25 22:02:53 +02:00
|
|
|
|
}
|
2012-07-20 21:57:29 +02:00
|
|
|
|
}
|
2012-04-25 22:02:53 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|