Beispiel #1
0
        private void OnLocationRequestResult(object sender, LocationCallbackResultEventArgs e)
        {
            if (e.Result.Locations.Count < 1)
            {
                return;
            }
            Location accurateLocation = e.Result.Locations.Aggregate((location1, location2) =>
                                                                     location1.Accuracy < location2.Accuracy ? location1 : location2);

            if (OldLocation == null)
            {
                OldLocation = accurateLocation;
            }

            float t = accurateLocation.Time - OldLocation.Time;

            if (accurateLocation.Accuracy < OldLocation.Accuracy || t * 1000 > 300)
            {
                OldLocation = accurateLocation;
            }

            if (accurateLocation.Accuracy > 30)
            {
                return;
            }

            OldLocation = accurateLocation;
            var addressResultReceiver = new MapPageRendererAddressResultReceiver(new Handler(), this);

            StartAddressIntentService(addressResultReceiver, accurateLocation);
        }
Beispiel #2
0
 private void OnLocationResult(object sender, LocationCallbackResultEventArgs e)
 {
     foreach (var location in e.Result.Locations)
     {
         Toast.MakeText(this, $"Location Update Received: ({location.Latitude}, {location.Longitude})", ToastLength.Short).Show();
     }
 }
Beispiel #3
0
        private async void LocationCallback_LocationResult(object sender, LocationCallbackResultEventArgs e)
        {
            var LastLocation = await GeoLocationServiceClass.DB.Table <DeviceLocation>().OrderByDescending(r => r.IdReg).FirstOrDefaultAsync();

            latitude.Text  = LastLocation.Latitude.ToString();
            longitude.Text = LastLocation.Longitude.ToString();
            provider.Text  = LastLocation.IdReg.ToString();
        }
Beispiel #4
0
 /// <summary>
 /// Fused location provider found one / multiple location point.
 /// </summary>
 private void FusedLocationCallback_LocationResult(object sender, LocationCallbackResultEventArgs e)
 {
     if (e.Result.Locations != null)
     {
         foreach (var location in e.Result.Locations)
         {
             UpdateLocation(location);
         }
     }
 }
Beispiel #5
0
 void LocationCallback_LocationResult(object sender, LocationCallbackResultEventArgs e)
 {
     textLocationUpdates.Text = DescribeLocation(e.Result.LastLocation);
 }