2013-04-12 19:59:16 +02:00
|
|
|
|
// XAML Map Control - http://xamlmapcontrol.codeplex.com/
|
2016-02-23 20:07:30 +01:00
|
|
|
|
// © 2016 Clemens Fischer
|
2013-04-12 19:59:16 +02:00
|
|
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
|
|
|
2015-08-09 20:04:44 +02:00
|
|
|
|
#if NETFX_CORE
|
2015-02-10 17:25:00 +01:00
|
|
|
|
using Windows.UI.Xaml.Media;
|
2013-04-12 19:59:16 +02:00
|
|
|
|
#else
|
2015-02-10 17:25:00 +01:00
|
|
|
|
using System.Windows.Media;
|
2013-04-12 19:59:16 +02:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
2015-02-10 17:25:00 +01:00
|
|
|
|
/// 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.
|
2015-02-18 19:20:59 +01:00
|
|
|
|
/// The Stretch property is meaningless for MapPath, it will be reset to None.
|
2013-04-12 19:59:16 +02:00
|
|
|
|
/// </summary>
|
2013-05-25 08:53:50 +02:00
|
|
|
|
public partial class MapPath : IMapElement
|
2013-04-12 19:59:16 +02:00
|
|
|
|
{
|
|
|
|
|
|
private MapBase parentMap;
|
|
|
|
|
|
|
|
|
|
|
|
public MapBase ParentMap
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return parentMap; }
|
2014-11-19 21:11:14 +01:00
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
parentMap = value;
|
|
|
|
|
|
UpdateData();
|
|
|
|
|
|
}
|
2013-04-12 19:59:16 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2013-05-25 08:53:50 +02:00
|
|
|
|
protected virtual void UpdateData()
|
2013-04-12 19:59:16 +02:00
|
|
|
|
{
|
2015-02-10 17:25:00 +01:00
|
|
|
|
if (Data != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (parentMap != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
Data.Transform = ParentMap.ViewportTransform;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Data.ClearValue(Geometry.TransformProperty);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2013-04-12 19:59:16 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|