using Darnton.Units;
using System;
using System.Text.Json.Serialization;
namespace Darnton.Blazor.DeviceInterop.Geolocation
{
///
/// Geolocation Position, based on .
///
public class GeolocationPosition
{
///
/// The coordinates defining the current location
///
public GeolocationCoordinates Coords { get; set; }
///
/// The time the coordinates were taken, in milliseconds since the Unix epoch.
///
public long Timestamp { get; set; }
///
/// The derived from the Timestamp, in UTC.
///
[JsonIgnore]
public DateTimeOffset DateTimeOffset => (Timestamp / 1000).FromUnixTime().ToDateTimeOffset();
}
}