XAML-Map-Control/MapControl/ImageTileSource.Silverlight.WinRT.cs
ClemensF 10527c3f0d Version 2.0:
- Support for Windows Phone 8.1 by making MapControl.WinRT a portable library
- Unified TileContainer and MapOverlay implementations across platforms
2014-07-01 18:57:44 +02:00

30 lines
865 B
C#

// XAML Map Control - http://xamlmapcontrol.codeplex.com/
// Copyright © 2014 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
#if WINDOWS_RUNTIME
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;
#else
using System.Windows.Media;
using System.Windows.Media.Imaging;
#endif
namespace MapControl
{
/// <summary>
/// Provides the image of a map tile. ImageTileSource bypasses image
/// downloading in TileImageLoader. By overriding the LoadImage method,
/// an application can provide tile images from an arbitrary source.
/// </summary>
public class ImageTileSource : TileSource
{
public virtual ImageSource LoadImage(int x, int y, int zoomLevel)
{
var uri = GetUri(x, y, zoomLevel);
return uri != null ? new BitmapImage(uri) : null;
}
}
}