2012-11-22 21:42:29 +01:00
|
|
|
|
// XAML Map Control - http://xamlmapcontrol.codeplex.com/
|
2013-05-07 18:12:25 +02:00
|
|
|
|
// Copyright © Clemens Fischer 2012-2013
|
2012-05-04 12:52:20 +02:00
|
|
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
2012-04-25 22:02:53 +02:00
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
2013-01-03 15:33:46 +01:00
|
|
|
|
public partial class Tile
|
2012-04-25 22:02:53 +02:00
|
|
|
|
{
|
2013-03-15 18:08:51 +01:00
|
|
|
|
public static TimeSpan AnimationDuration = TimeSpan.FromSeconds(0.5);
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2013-11-12 21:14:53 +01:00
|
|
|
|
public bool HasImageSource { get; private 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;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|