public async Task GetUserAddress() { var locator = CrossGeolocator.Current; locator.DesiredAccuracy = 250; Plugin.Geolocator.Abstractions.Position position = await GetCurrentLocation(); lon = position.Longitude; lat = position.Latitude; string mapkey = null; var address = await locator.GetAddressesForPositionAsync(position, mapkey); userAddress = address.FirstOrDefault(); // Gets the users address }
public async Task GetUserAddress() { var locator = CrossGeolocator.Current; locator.DesiredAccuracy = 250; Plugin.Geolocator.Abstractions.Position position = await GetCurrentLocation(); // This plugin function gets the users location and creates a variable for it lon = position.Longitude; lan = position.Latitude; string mapkey = null; var address = await locator.GetAddressesForPositionAsync(position, mapkey); usersAddress = address.FirstOrDefault(); // Passes the address back to the main code }