mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 22:18:56 +00:00
Avoid unnecessary Location and Point allocations
This commit is contained in:
parent
f44d2207e5
commit
e268be2948
20 changed files with 205 additions and 172 deletions
|
|
@ -41,13 +41,11 @@ namespace MapControl
|
|||
}
|
||||
|
||||
UpdateData();
|
||||
InvalidateVisual(); // necessary for StreamGeometry
|
||||
}
|
||||
|
||||
bool IWeakEventListener.ReceiveWeakEvent(Type managerType, object sender, EventArgs e)
|
||||
{
|
||||
UpdateData();
|
||||
InvalidateVisual(); // necessary for StreamGeometry
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -81,10 +79,7 @@ namespace MapControl
|
|||
|
||||
private void AddPolylinePoints(StreamGeometryContext context, IEnumerable<Location> locations, double longitudeOffset, bool closed)
|
||||
{
|
||||
var points = locations
|
||||
.Select(location => LocationToView(location, longitudeOffset))
|
||||
.Where(point => point.HasValue)
|
||||
.Select(point => point.Value);
|
||||
var points = LocationsToView(locations, longitudeOffset);
|
||||
|
||||
if (points.Any())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue