mirror of
https://github.com/farcasclaudiu/BlazorDeviceInterop.git
synced 2026-06-22 07:01:03 +03:00
Reorganise project structure and namespaces. Remove Leaflet project and replace with Darnton.Blazor.Leaflet package.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using Darnton.Units;
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Darnton.Blazor.DeviceInterop.Geolocation
|
||||
{
|
||||
/// <summary>
|
||||
/// Geolocation Position, based on <see href="https://developer.mozilla.org/en-US/docs/Web/API/GeolocationPosition"/>.
|
||||
/// </summary>
|
||||
public class GeolocationPosition
|
||||
{
|
||||
/// <summary>
|
||||
/// The coordinates defining the current location
|
||||
/// </summary>
|
||||
public GeolocationCoordinates Coords { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The time the coordinates were taken, in milliseconds since the Unix epoch.
|
||||
/// </summary>
|
||||
public long Timestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="DateTimeOffset"/> derived from the Timestamp, in UTC.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public DateTimeOffset DateTimeOffset => (Timestamp / 1000).FromUnixTime().ToDateTimeOffset();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user