Esempio n. 1
0
        protected async Task UpdateRunStats(Geoposition obj)
        {
            _Waypoints.Add(obj.ToGeoPoint());

            var route = await MapServiceWrapper.Instance.GetRoute(_Waypoints);

            if (route != null)
            {
                OnRouteUpdate?.Invoke(this, route);
                double distanceDiff = route.LengthInMeters - RunData.Distance;
                RunData.Distance         = route.LengthInMeters;
                RunData.Speed            = (distanceDiff / 1000) / (_lastLocationTimeSeconds / 60.0 / 60.0);
                _lastLocationTimeSeconds = RunData.Time.Seconds;
            }
        }
Esempio n. 2
0
 public void Instance_OnLocationChange(Geoposition obj)
 {
     CurrentLocation = obj.ToGeoPoint();
 }