// :Helper functions private void SetupGPS(GPS_ACCURACY accuracy, double movementThreshold) { if (GPS == null) { GPS = new Geolocator(); switch (accuracy) { case GPS_ACCURACY.HIGH: GPS.DesiredAccuracy = PositionAccuracy.High; break; case GPS_ACCURACY.LOW: GPS.DesiredAccuracy = PositionAccuracy.Default; break; default: GPS.DesiredAccuracy = PositionAccuracy.High; break; } GPS.MovementThreshold = movementThreshold; GPS.PositionChanged += GPSPositionChanged; } }
// Functions // :Constructors /// <summary> /// Default constructor. /// </summary> /// <param name="accuracy">How accurate the position should be. High is preferred for accurate route.</param> /// <param name="movementThreshold">How many 'meters' there should be from last position to trigger position changed event('GPSLocationChanged').</param> public GPSService(GPS_ACCURACY accuracy = GPS_ACCURACY.HIGH, double movementThreshold = 50) { // Setup _accuracy = accuracy; _movementThreshold = movementThreshold; }