sharee.bike-App/SharedBusinessLogic/Services/Geolocation/LocationHelper.cs
2024-04-09 12:53:23 +02:00

21 lines
540 B
C#

using Xamarin.Essentials;
namespace ShareeBike.Services.Geolocation
{
public static class LocationHelper
{
/// <summary>
/// Converts Xamarin.Essentials Location object to Geolocatin object.
/// </summary>
/// <param name="location"></param>
/// <returns></returns>
public static IGeolocation ToGeolocation(this Location location)
=> new Geolocation.Builder
{
Latitude = location.Latitude,
Longitude = location.Longitude,
Accuracy = location.Accuracy,
Timestamp = location.Timestamp,
}.Build();
}
}