mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 14:08:32 +00:00
Version 4.4.1: MapPolygon for UWP in progress
This commit is contained in:
parent
946713b8eb
commit
2f828fbe2d
7 changed files with 64 additions and 30 deletions
|
|
@ -18,6 +18,11 @@ namespace MapControl
|
|||
nameof(Locations), typeof(IEnumerable<Location>), typeof(MapPolygon),
|
||||
new PropertyMetadata(null, (o, e) => ((MapPolygon)o).LocationsPropertyChanged(e)));
|
||||
|
||||
public MapPolygon()
|
||||
: base(new PathGeometry())
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Locations that define the polyline points.
|
||||
/// </summary>
|
||||
|
|
@ -29,8 +34,7 @@ namespace MapControl
|
|||
|
||||
protected override void UpdateData()
|
||||
{
|
||||
var figures = ((PathGeometry)Data).Figures;
|
||||
figures.Clear();
|
||||
((PathGeometry)Data).Figures.Clear();
|
||||
|
||||
if (ParentMap != null && Locations != null && Locations.Count() >= 2)
|
||||
{
|
||||
|
|
@ -42,7 +46,7 @@ namespace MapControl
|
|||
locations = locations.Select(loc => new Location(loc.Latitude, loc.Longitude + offset));
|
||||
}
|
||||
|
||||
var points = locations.Select(loc => ParentMap.MapProjection.LocationToViewportPoint(loc)).ToList();
|
||||
var points = locations.Select(loc => LocationToViewportPoint(loc)).ToList();
|
||||
points.Add(points[0]);
|
||||
|
||||
CreatePolylineFigures(points);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,11 @@ namespace MapControl
|
|||
nameof(Locations), typeof(IEnumerable<Location>), typeof(MapPolyline),
|
||||
new PropertyMetadata(null, (o, e) => ((MapPolyline)o).LocationsPropertyChanged(e)));
|
||||
|
||||
public MapPolyline()
|
||||
: base(new PathGeometry())
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Locations that define the polyline points.
|
||||
/// </summary>
|
||||
|
|
@ -41,7 +46,7 @@ namespace MapControl
|
|||
locations = locations.Select(loc => new Location(loc.Latitude, loc.Longitude + offset));
|
||||
}
|
||||
|
||||
var points = locations.Select(loc => ParentMap.MapProjection.LocationToViewportPoint(loc)).ToList();
|
||||
var points = locations.Select(loc => LocationToViewportPoint(loc)).ToList();
|
||||
|
||||
CreatePolylineFigures(points);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue