Esempio n. 1
0
 // Function for direct the map back to user location
 void RedirectMapToCurrentLocation()
 {
     // Update Current Location
     UserLocation.UpdateMyCoordinate();
     // Redirect the map to user current location
     myMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(UserLocation.Latitude, UserLocation.Longitude), Distance.FromMiles(1)));
 }
Esempio n. 2
0
        // Redirect the map back to the target location
        // If there is no target on the map, will back to the user location
        void RedirectMapToCurrentLocation(string toWhere)
        {
            // Update Current Location
            UserLocation.UpdateMyCoordinate();

            if (PositionsList.Count == 0 || toWhere == "User")
            {
                // Redirect the map to user current location
                myMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(UserLocation.Latitude, UserLocation.Longitude), Distance.FromMiles(1)));
            }
            else if (PositionsList.Count != 0 && toWhere == "Target")
            {
                // Redirect the map the the object location
                myMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(PositionsList[0].Latitude, PositionsList[0].Longitude), Distance.FromMiles(1)));
            }
        }
Esempio n. 3
0
 // Function for direct the map back to user location
 void RedirectMapToLocation(string toWhere)
 {
     // Update Current Location
     UserLocation.UpdateMyCoordinate();
     // If there is no shape on the map or we decide to direct the map to the user location
     if (InsertDataPage.PositionsList.Count == 0 || toWhere == "User")
     {
         // Redirect the map to user current location
         myMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(UserLocation.Latitude, UserLocation.Longitude), Distance.FromMiles(1)));
     }
     // If there is a shape on the map or we want to direct the map to the object
     else if (InsertDataPage.PositionsList.Count != 0 && toWhere == "Target")
     {
         // Redirect the map the the object location
         myMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(InsertDataPage.PositionsList[0].Latitude,
                                                                     InsertDataPage.PositionsList[0].Longitude),
                                                        Distance.FromMiles(1)));
     }
 }
Esempio n. 4
0
 public MainPage()
 {
     InitializeComponent();
     UserLocation.UpdateMyCoordinate();
 }
Esempio n. 5
0
 public void SetUp()
 {
     UserLocation.UpdateMyCoordinate();
 }
Esempio n. 6
0
 public void CanUpdateUserCurrentCoordinateTest()
 {
     UserLocation.UpdateMyCoordinate();
     Assert.IsNotNull(UserLocation.Latitude);
     Assert.IsNotNull(UserLocation.Longitude);
 }