72 lines
1.6 KiB
C#
72 lines
1.6 KiB
C#
using System.Globalization;
|
|
using System.Runtime.Serialization;
|
|
|
|
namespace CampusAppWPortalLib8.Model.Utility
|
|
{
|
|
public class GeoMapPoint : MapPoint
|
|
{
|
|
#region Constructor
|
|
|
|
public GeoMapPoint(double latitude, double longitude, long timestamp)
|
|
: base(longitude, latitude)
|
|
{
|
|
this.Timestamp = timestamp;
|
|
}
|
|
|
|
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
|
|
|
|
[DataMember]
|
|
public double Latitude
|
|
{
|
|
get
|
|
{
|
|
return this.Y;
|
|
}
|
|
|
|
set
|
|
{
|
|
this.Y = value;
|
|
}
|
|
}
|
|
|
|
[DataMember]
|
|
public double Longitude
|
|
{
|
|
get
|
|
{
|
|
return this.X;
|
|
}
|
|
|
|
set
|
|
{
|
|
this.X = value;
|
|
}
|
|
}
|
|
|
|
[DataMember]
|
|
public long Timestamp { get; set; }
|
|
|
|
|
|
#endregion
|
|
}
|
|
}
|