public void Init() { if (!locationWatcher.Started) { locationWatcher.Start( new MvxLocationOptions{Accuracy = MvxLocationAccuracy.Coarse}, loc => { UserLocation = loc; const double tolerance = 0.001; if (Math.Abs(loc.Coordinates.Latitude) > tolerance && Math.Abs(loc.Coordinates.Longitude) > tolerance) locationWatcher.Stop(); }, error => { }); } // defaults userAge = 0; userId = string.Empty; userGender = Gender.Unknown; userLocation = new MvxGeoLocation { Coordinates = new MvxCoordinates { Latitude = 0, Longitude = 0, Accuracy = 0 } }; }
private void OnSuccess(MvxGeoLocation obj) { _parent.RunOnUiThread(() => { Lat = obj.Coordinates.Latitude; Lng = obj.Coordinates.Longitude; }); }
protected virtual void SendLocation(MvxGeoLocation location) { LastSeenLocation = location; var callback = _locationCallback; if (callback != null) callback(location); }
private void OnSuccess(MvxGeoLocation location) { var message = new LocationMessage(this, location.Coordinates.Latitude, location.Coordinates.Longitude); _messenger.Publish(message); }
private void OnNewLocation(MvxGeoLocation location) { if (location != null && location.Coordinates != null) { Lat = location.Coordinates.Latitude; Lng = location.Coordinates.Longitude; } }
protected virtual void SendLocation(MvxGeoLocation location) { var callback = _locationCallback; if (callback != null) { callback(location); } }
private void OnLocationFound(MvxGeoLocation location) { try { Lat = location.Coordinates.Latitude.ToString(); Lon = location.Coordinates.Longitude.ToString(); } catch (Exception ex) { } }
private void OnSuccess(MvxGeoLocation location) { lock (_lockObject) { _latestLocation = location; } var message = new LocationMessage(this, location.Coordinates.Latitude, location.Coordinates.Longitude); _messenger.Publish(message); }
private void OnLocation(MvxGeoLocation location) { Location = location; }
private void OnLocation(MvxGeoLocation obj) { }
void OnLocation(MvxGeoLocation location) { this.LastKnownLocation = location; }
public LocationUpdatedMessege(object sender, MvxGeoLocation location = null) : base(sender) { Location = location; }
private void UpdateLocation(MvxGeoLocation location) { var lat = "Unknown"; var lng = "Unknown"; if (location != null && location.Coordinates != null) { lat = location.Coordinates.Latitude.ToString(); lng = location.Coordinates.Longitude.ToString(); } _latText.Text = lat; _lngText.Text = lng; }
private void OnLocation(MvxGeoLocation location) { RunOnUiThread(() => UpdateLocation(location)); }
private void OnLocation(MvxGeoLocation location) { Lat = location.Coordinates.Latitude; Lng = location.Coordinates.Longitude; HasGpsLocation = true; }
private void OnLocation(MvxGeoLocation location) { StatusMessage = "Current location is:"; Latitude = location.Coordinates.Latitude.ToString(); Longitude = location.Coordinates.Longitude.ToString(); }
public MvxGeoLocation ComputeCurrentPosition() { _lastUpdate = DateTime.UtcNow; _currentLocationIndex = _currentLocationIndex + 1; var location = _sensorData.Locations[_currentLocationIndex]; _currentLocation = ConvertToMvxGeoLocation(location); return _currentLocation; }
private static MvxGeoLocation CreateLocation(Location androidLocation) { var position = new MvxGeoLocation {Timestamp = androidLocation.Time.FromMillisecondsUnixTimeToUtc()}; var coords = position.Coordinates; if (androidLocation.HasAltitude) coords.Altitude = androidLocation.Altitude; if (androidLocation.HasBearing) coords.Heading = androidLocation.Bearing; coords.Latitude = androidLocation.Latitude; coords.Longitude = androidLocation.Longitude; if (androidLocation.HasSpeed) coords.Speed = androidLocation.Speed; if (androidLocation.HasAccuracy) { coords.Accuracy = androidLocation.Accuracy; } return position; }