Ugly bugfix

This commit is contained in:
2016-01-07 11:56:00 +01:00
parent 3433d6e038
commit 7e1e4432a0
2 changed files with 18 additions and 8 deletions
+12 -7
View File
@@ -134,9 +134,12 @@ namespace NavCityBreda.Views
if (App.RouteManager.CurrentRoute == null) return; if (App.RouteManager.CurrentRoute == null) return;
GeofenceMonitor.Current.Geofences.Clear(); while (Map.MapElements.Any() || GeofenceMonitor.Current.Geofences.Any())
Map.MapElements.Clear(); {
await Task.Delay(TimeSpan.FromMilliseconds(100)); Map.MapElements.Clear();
await Task.Delay(TimeSpan.FromMilliseconds(100));
GeofenceMonitor.Current.Geofences.Clear();
}
Map.MapElements.Add(CurrentPosition); Map.MapElements.Add(CurrentPosition);
Map.MapElements.Add(CurrentNavigationLine); Map.MapElements.Add(CurrentNavigationLine);
@@ -158,10 +161,12 @@ namespace NavCityBreda.Views
private async void RemoveRoute() private async void RemoveRoute()
{ {
Track(false); Track(false);
await Task.Delay(TimeSpan.FromMilliseconds(100)); while (Map.MapElements.Any() || GeofenceMonitor.Current.Geofences.Any())
Map.MapElements.Clear(); {
await Task.Delay(TimeSpan.FromMilliseconds(100)); Map.MapElements.Clear();
GeofenceMonitor.Current.Geofences.Clear(); await Task.Delay(TimeSpan.FromMilliseconds(100));
GeofenceMonitor.Current.Geofences.Clear();
}
await Task.Delay(TimeSpan.FromMilliseconds(100)); await Task.Delay(TimeSpan.FromMilliseconds(100));
DrawCurrenPosition(App.Geo.Position.Coordinate.Point); DrawCurrenPosition(App.Geo.Position.Coordinate.Point);
} }
+6 -1
View File
@@ -2,6 +2,7 @@
using NavCityBreda.Model.Object; using NavCityBreda.Model.Object;
using NavCityBreda.ViewModels; using NavCityBreda.ViewModels;
using System; using System;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Windows.UI; using Windows.UI;
using Windows.UI.Xaml; using Windows.UI.Xaml;
@@ -49,7 +50,11 @@ namespace NavCityBreda.Views
private async void DrawRoute() private async void DrawRoute()
{ {
Map.MapElements.Clear(); while (Map.MapElements.Any())
{
Map.MapElements.Clear();
await Task.Delay(TimeSpan.FromMilliseconds(100));
}
Zoom(); Zoom();