private void setPositions(Position position) { currentPosition = position; GlobalFuncs.gpsOn = true; string latitude = "" + Math.Round(position.Latitude, 5); string longitude = "" + Math.Round(position.Longitude, 5); string writePosition = latitude + ", " + longitude; if (getNewPos) { Task.Run(async() => { await WritePositionWithLocation(position); }); } if (fvm != null) { fvm.Position = writePosition; fvm.PositionLocation = writePositionLocation; } if (mvm != null) { mvm.Position = writePosition; mvm.PositionLocation = writePositionLocation; } if (uvm != null) { uvm.Position = writePosition; uvm.PositionLocation = writePositionLocation; } if (cavm != null) { cavm.Position = writePosition; cavm.PositionLocation = writePositionLocation; } if (pvm != null) { pvm.Latitude = position.Latitude.ToString(); pvm.Longitude = position.Longitude.ToString(); pvm.Altitude = position.Altitude.ToString() + " m"; pvm.PositionLocation = writePositionLocation; } if (vc != null) { vc.Position = writePosition; vc.PositionLocation = writePositionLocation; vc.Distance = getDistance(); if (GlobalFuncs.mvm.tracked != null) { a = GlobalFuncs.calcDist(GlobalFuncs.mvm.returnmypos(), GlobalFuncs.mvm.tracked.Position); b = GlobalFuncs.calcDist(currentPosition, GlobalFuncs.mvm.tracked.Position); if (b >= a) { vc.DecimalD = 0.0; } else { //TODO vc.DecimalD = 1.0 - (b / a); } } else { vc.DecimalD = 0; } } fvm.RecalculateDistance(); mvm.RecalculateDistance(); check(position); }