sharee.bike-App/TINKLib/Services/Geolocation/LocationHelper.cs
2023-04-05 15:02:10 +02:00

21 lines
534 B
C#

using Xamarin.Essentials;
namespace TINK.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();
}
}