101 lines
3.1 KiB
C#
101 lines
3.1 KiB
C#
//-----------------------------------------------------------------------
|
|
// <copyright file="GeoMapPoint.cs" company="BTU/IIT">
|
|
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
|
// </copyright>
|
|
// <author>Stubbfel</author>
|
|
// <date>23.10.2013</date>
|
|
// <summary>Implements the geo map point class</summary>
|
|
//-----------------------------------------------------------------------
|
|
namespace CampusAppWPortalLib8.Model.Utility
|
|
{
|
|
using System.Globalization;
|
|
|
|
/// <summary> A geo map point. </summary>
|
|
/// <remarks> Stubbfel, 23.10.2013. </remarks>
|
|
/// <seealso cref="T:CampusAppWPortalLib8.Model.Utility.MapPoint"/>
|
|
public class GeoMapPoint : MapPoint
|
|
{
|
|
#region Constructor
|
|
|
|
/// <summary> Initializes a new instance of the GeoMapPoint class. </summary>
|
|
/// <remarks> Stubbfel, 23.10.2013. </remarks>
|
|
public GeoMapPoint()
|
|
{
|
|
}
|
|
|
|
/// <summary> Initializes a new instance of the GeoMapPoint class. </summary>
|
|
/// <remarks> Stubbfel, 23.10.2013. </remarks>
|
|
/// <param name="latitude"> The latitude. </param>
|
|
/// <param name="longitude"> The longitude. </param>
|
|
/// <param name="timestamp"> The timestamp. </param>
|
|
public GeoMapPoint(double latitude, double longitude, long timestamp)
|
|
: base(longitude, latitude)
|
|
{
|
|
this.Timestamp = timestamp;
|
|
}
|
|
|
|
/// <summary> Initializes a new instance of the GeoMapPoint class. </summary>
|
|
/// <remarks> Stubbfel, 23.10.2013. </remarks>
|
|
/// <param name="latitude"> The latitude. </param>
|
|
/// <param name="longitude"> The longitude. </param>
|
|
/// <param name="timestamp"> The timestamp. </param>
|
|
public GeoMapPoint(string latitude, string longitude, string timestamp)
|
|
{
|
|
double lat;
|
|
double log;
|
|
long time;
|
|
|
|
if (double.TryParse(latitude, NumberStyles.Number, CultureInfo.InvariantCulture, out lat)
|
|
&& double.TryParse(longitude, NumberStyles.Number, CultureInfo.InvariantCulture, out log)
|
|
&& long.TryParse(timestamp, NumberStyles.Number, CultureInfo.InvariantCulture, out time))
|
|
{
|
|
this.Latitude = lat;
|
|
this.Longitude = log;
|
|
this.Timestamp = time;
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Property
|
|
|
|
/// <summary> Gets or sets the latitude. </summary>
|
|
/// <value> The latitude. </value>
|
|
public double Latitude
|
|
{
|
|
get
|
|
{
|
|
return this.Y;
|
|
}
|
|
|
|
set
|
|
{
|
|
this.Y = value;
|
|
}
|
|
}
|
|
|
|
/// <summary> Gets or sets the longitude. </summary>
|
|
/// <value> The longitude. </value>
|
|
public double Longitude
|
|
{
|
|
get
|
|
{
|
|
return this.X;
|
|
}
|
|
|
|
set
|
|
{
|
|
this.X = value;
|
|
}
|
|
}
|
|
|
|
/// <summary> Gets or sets the timestamp. </summary>
|
|
/// <value> The timestamp. </value>
|
|
public long Timestamp { get; set; }
|
|
|
|
|
|
#endregion
|
|
}
|
|
}
|