namespace Cef3 { using System; using System.Collections.Generic; using System.Text; using Cef3.Interop; /// /// Structure representing geoposition information. The properties of this /// structure correspond to those of the JavaScript Position object although /// their types may differ. /// public unsafe sealed class CefGeoposition { internal static CefGeoposition FromNative(cef_geoposition_t* position) { return new CefGeoposition(position); } private readonly double _latitude; private readonly double _longitude; private readonly double _altitude; private readonly double _accuracy; private readonly double _altitudeAccuracy; private readonly double _heading; private readonly double _speed; private readonly DateTime _timestamp; private readonly CefGeopositionErrorCode _errorCode; private readonly string _errorMessage; private CefGeoposition(cef_geoposition_t* position) { _latitude = position->latitude; _longitude = position->longitude; _altitude = position->altitude; _accuracy = position->accuracy; _altitudeAccuracy = position->altitude_accuracy; _heading = position->heading; _speed = position->speed; _timestamp = cef_time_t.ToDateTime(&position->timestamp); _errorCode = position->error_code; _errorMessage = cef_string_t.ToString(&position->error_message); } /// /// Latitude in decimal degrees north (WGS84 coordinate frame). /// public double Latitude { get { return _latitude; } } /// /// Longitude in decimal degrees west (WGS84 coordinate frame). /// public double Longitude { get { return _longitude; } } /// /// Altitude in meters (above WGS84 datum). /// public double Altitude { get { return _altitude; } } /// /// Accuracy of horizontal position in meters. /// public double Accuracy { get { return _accuracy; } } /// /// Accuracy of altitude in meters. /// public double AltitudeAccuracy { get { return _altitudeAccuracy; } } /// /// Heading in decimal degrees clockwise from true north. /// public double Heading { get { return _heading; } } /// /// Horizontal component of device velocity in meters per second. /// public double Speed { get { return _speed; } } /// /// Time of position measurement in milliseconds since Epoch in UTC time. This /// is taken from the host computer's system clock. /// public DateTime Timestamp { get { return _timestamp; } } /// /// Error code, see enum above. /// public CefGeopositionErrorCode ErrorCode { get { return _errorCode; } } /// /// Human-readable error message. /// public string ErrorMessage { get { return _errorMessage; } } } }