mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Reworked MapPath and derived classes
This commit is contained in:
parent
414389513e
commit
49d508b3f5
9 changed files with 106 additions and 84 deletions
|
|
@ -14,10 +14,7 @@ namespace MapControl
|
|||
{
|
||||
public partial class MapPath : Path
|
||||
{
|
||||
protected void DataCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
UpdateData();
|
||||
}
|
||||
#region Method used only by derived classes MapPolyline and MapPolygon
|
||||
|
||||
protected void DataCollectionPropertyChanged(DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
|
|
@ -34,11 +31,17 @@ namespace MapControl
|
|||
UpdateData();
|
||||
}
|
||||
|
||||
protected void AddPolylineLocations(PathFigureCollection figures, IEnumerable<Location> locations, bool closed)
|
||||
protected void DataCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
if (locations != null && locations.Count() >= 2)
|
||||
UpdateData();
|
||||
}
|
||||
|
||||
protected void AddPolylineLocations(PathFigureCollection pathFigures, IEnumerable<Location> locations, double longitudeOffset, bool closed)
|
||||
{
|
||||
if (locations.Count() >= 2)
|
||||
{
|
||||
var points = locations.Select(loc => LocationToView(loc)).ToList();
|
||||
var points = locations.Select(location => LocationToView(location, longitudeOffset)).ToList();
|
||||
|
||||
if (closed)
|
||||
{
|
||||
points.Add(points[0]);
|
||||
|
|
@ -67,7 +70,7 @@ namespace MapControl
|
|||
|
||||
segment = new PolyLineSegment();
|
||||
figure.Segments.Add(segment);
|
||||
figures.Add(figure);
|
||||
pathFigures.Add(figure);
|
||||
}
|
||||
|
||||
segment.Points.Add(p2);
|
||||
|
|
@ -80,5 +83,7 @@ namespace MapControl
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue