XAML-Map-Control/MapControl/MapPath.cs
ClemensF 98cdc95c5d Version 2.5.0:
- moved tile rect calculation from MapBase to TileLayer
- added TileLayer.ZoomLevelOffset property
- Windows Universal sample application in solution MapControl VS2015
2015-08-09 20:04:44 +02:00

48 lines
1.2 KiB
C#

// XAML Map Control - http://xamlmapcontrol.codeplex.com/
// © 2015 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
#if NETFX_CORE
using Windows.UI.Xaml.Media;
#else
using System.Windows.Media;
#endif
namespace MapControl
{
/// <summary>
/// Base class for map shapes. The shape geometry is given by the Data property,
/// which must contain a Geometry defined in cartesian (projected) map coordinates.
/// The Stretch property is meaningless for MapPath, it will be reset to None.
/// </summary>
public partial class MapPath : IMapElement
{
private MapBase parentMap;
public MapBase ParentMap
{
get { return parentMap; }
set
{
parentMap = value;
UpdateData();
}
}
protected virtual void UpdateData()
{
if (Data != null)
{
if (parentMap != null)
{
Data.Transform = ParentMap.ViewportTransform;
}
else
{
Data.ClearValue(Geometry.TransformProperty);
}
}
}
}
}