/// <summary>
 /// Ons the appear.
 /// </summary>
 /// <returns>The appear.</returns>
 public void OnAppear()
 {
     _subscriptions = _geolocator.Positions.Subscribe(x =>
     {
         _currentPosition = x;
         LocationUpdates.OnNext(x);
     });
 }
 /// <summary>
 /// Notifies the update.
 /// </summary>
 /// <param name="location">Location.</param>
 private void NotifyLocationUpdate(Android.Locations.Location location)
 {
     LocationUpdates.OnNext(
         new LocationUpdatedEventArgs
             (new Portable.Location.Location()
     {
         Longitude = location.Longitude,
         Latitude  = location.Latitude,
     }));
 }
Пример #3
0
        /// <summary>
        /// Notifies the update.
        /// </summary>
        /// <param name="location">Location.</param>
        private void NotifyLocationUpdate(CLLocation location)
        {
            var latitude  = location.Coordinate.Latitude;
            var longitude = location.Coordinate.Longitude;

            //var e.Locations [e.Locations.Length - 1]
            LocationUpdates.OnNext(new LocationUpdatedEventArgs
                                       (new Location()
            {
                Longitude = longitude,
                Latitude  = latitude,
            }));

            GetLocationAddress(latitude, longitude)
            .ContinueWith(_ => NotifyAddressUpdate(_.Result));
        }