public void SwitchToNavigator(GeoPlacemark destination)
        {
            int    nodeID = int.MaxValue;
            double tempDistance = double.PositiveInfinity, dummy;

            foreach (GeoPoint point in allPoints)
            {
                if ((dummy = LatLongMath.GetDistance(currentPosition, point.Position)) < tempDistance)
                {
                    tempDistance = dummy;
                    nodeID       = point.ID;
                }
            }

            if (nodeID != int.MaxValue)
            {
                pathWay = FindShortestPath(pointsByID[nodeID], destination);
            }

            GeoPlacemark place = pathWay.ElementAt(0);

            place.Distance    = LatLongMath.GetDistance(currentPosition, place.Position);
            place.Orientation = LatLongMath.GetCompassBearing(currentPosition, place.Position);

            Mode = AugmentedMode.Navigator;
        }
        public void PositionUpdate(GeoCoordinate position)
        {
            currentPosition = position;
            if (Mode == AugmentedMode.Explorer)
            {
                UpdatePlacemarks();
            }
            else if (Mode == AugmentedMode.Navigator)
            {
                if (pathWay != null)
                {
                    if (pathWay.Count > 0)
                    {
                        if (LatLongMath.GetDistance(position, pathWay.ElementAt(0).Position) <= distanceThreshold)
                        {
                            pathWay.RemoveAt(0);
                        }
                    }

                    if (pathWay.Count > 0)
                    {
                        GeoPlacemark place = pathWay.ElementAt(0);
                        place.Orientation = LatLongMath.GetCompassBearing(position, place.Position);
                        place.Distance    = LatLongMath.GetDistance(position, place.Position);
                    }
                }
            }
        }
 private void UpdatePlacemarks()
 {
     foreach (GeoPlacemark placemark in allPlacemarks)
     {
         placemark.Orientation = LatLongMath.GetCompassBearing(currentPosition, placemark.Position);
         placemark.Distance    = LatLongMath.GetDistance(currentPosition, placemark.Position);
     }
 }