Use StreamGeometry in WPF MapPolypoint

This commit is contained in:
ClemensFischer 2024-05-26 12:39:40 +02:00
parent 84890090f8
commit acdfc1861f
4 changed files with 27 additions and 33 deletions

View file

@ -58,7 +58,8 @@ namespace MapControl
protected void UpdateData(IEnumerable<Location> locations, bool closed)
{
var pathFigures = new PathFigureCollection();
var pathFigures = ((PathGeometry)Data).Figures;
pathFigures.Clear();
if (ParentMap != null && locations != null)
{
@ -66,11 +67,9 @@ namespace MapControl
AddPolylinePoints(pathFigures, locations, longitudeOffset, closed);
}
((PathGeometry)Data).Figures = pathFigures;
}
protected void AddPolylinePoints(PathFigureCollection pathFigures, IEnumerable<Location> locations, double longitudeOffset, bool closed)
private void AddPolylinePoints(PathFigureCollection pathFigures, IEnumerable<Location> locations, double longitudeOffset, bool closed)
{
if (locations.Count() >= 2)
{