Example #1
0
        void UpdateMapElements(GeoCoordinate currentLoc)
        {
            Center = currentLoc;
            Pushpins.Clear();
            Pushpins.Add(new Pushpin {
                Location = currentLoc
            });
            Speed    = (currentLoc.Speed * 3.6).ToString();
            Altitude = currentLoc.Altitude.ToString();

            if (IsRecording == false)
            {
                return;
            }

            RouteLocations.Add(currentLoc);

            if (RouteLocations.Count - 2 >= 0)
            {
                Distance = Distance + RouteLocations[RouteLocations.Count - 2].GetDistanceTo(currentLoc);
            }
            if (Routes.Count == 0)
            {
                var routeModel = new RouteModel(RouteLocations);
                Routes.Add(routeModel);
                Route = routeModel;
            }
            NotifyPropertyChanged(() => Route);
            NotifyPropertyChanged(() => Routes);
        }
Example #2
0
        void StartWatcher(object o)
        {
            if (Watcher == null)
            {
                return;
            }
            Routes.Clear();

            Distance    = 0;
            Route       = new RouteModel(new ObservableCollection <GeoCoordinate>());
            IsRecording = true;
        }
Example #3
0
        void UpdateMapElements(GeoCoordinate currentLoc)
        {
            Center = currentLoc;
            Pushpins.Clear();
            Pushpins.Add(new Pushpin { Location = currentLoc });
            Speed = (currentLoc.Speed * 3.6).ToString();
            Altitude = currentLoc.Altitude.ToString();

            if (IsRecording == false)
            {
                return;
            }

            RouteLocations.Add(currentLoc);

            if (RouteLocations.Count - 2 >= 0)
            {
                Distance = Distance + RouteLocations[RouteLocations.Count - 2].GetDistanceTo(currentLoc);
            }
            if (Routes.Count == 0)
            {
                var routeModel = new RouteModel(RouteLocations);
                Routes.Add(routeModel);
                Route = routeModel;
            }
            NotifyPropertyChanged(()=>Route);
            NotifyPropertyChanged(()=>Routes);
        }
Example #4
0
        void StartWatcher(object o)
        {
            if (Watcher == null)
            {
                return;
            }
            Routes.Clear();

            Distance = 0;
            Route = new RouteModel(new ObservableCollection<GeoCoordinate>());
            IsRecording = true;
        }