This commit is contained in:
2016-01-07 11:02:00 +01:00
parent 6643c71824
commit ac63d0a0d7
2 changed files with 9 additions and 1 deletions
+3
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Windows.Devices.Geolocation; using Windows.Devices.Geolocation;
using Windows.Devices.Geolocation.Geofencing;
using Windows.System; using Windows.System;
namespace NavCityBreda.Model namespace NavCityBreda.Model
@@ -87,6 +88,8 @@ namespace NavCityBreda.Model
geo.PositionChanged += Geo_PositionChanged; geo.PositionChanged += Geo_PositionChanged;
geo.StatusChanged += Geo_StatusChanged; geo.StatusChanged += Geo_StatusChanged;
GeofenceMonitor.Current.Geofences.Clear();
_position = await geo.GetGeopositionAsync(); _position = await geo.GetGeopositionAsync();
return "Connected"; return "Connected";
+6 -1
View File
@@ -122,7 +122,9 @@ namespace NavCityBreda.Views
ZoomRoute(); ZoomRoute();
} }
else else
{
RemoveRoute(); RemoveRoute();
}
}); });
} }
@@ -155,11 +157,14 @@ namespace NavCityBreda.Views
} }
} }
private void RemoveRoute() private async void RemoveRoute()
{ {
Track(false); Track(false);
await Task.Delay(TimeSpan.FromMilliseconds(100));
Map.MapElements.Clear(); Map.MapElements.Clear();
await Task.Delay(TimeSpan.FromMilliseconds(100));
GeofenceMonitor.Current.Geofences.Clear(); GeofenceMonitor.Current.Geofences.Clear();
await Task.Delay(TimeSpan.FromMilliseconds(100));
DrawCurrenPosition(App.Geo.Position.Coordinate.Point); DrawCurrenPosition(App.Geo.Position.Coordinate.Point);
} }