CPF/CPF.Mac/Mac/CoreLocation/CLLocationCoordinate2D.cs
2023-11-21 23:05:03 +08:00

26 lines
552 B
C#

using System.Runtime.InteropServices;
namespace CPF.Mac.CoreLocation
{
public struct CLLocationCoordinate2D
{
public double Latitude;
public double Longitude;
public CLLocationCoordinate2D(double latitude, double longitude)
{
Latitude = latitude;
Longitude = longitude;
}
[DllImport("/System/Library/Frameworks/CoreLocation.framework/CoreLocation")]
private static extern int CLLocationCoordinate2DIsValid(CLLocationCoordinate2D cord);
public bool IsValid()
{
return CLLocationCoordinate2DIsValid(this) != 0;
}
}
}