public static void SetDistanceAndAngleGeocacheFromLocation(GAPPSF.Core.Data.Geocache gc, GAPPSF.Core.Data.Location loc) { GeodeticMeasurement gm = CalculateDistance(loc.Lat, loc.Lon, gc.Lat, gc.Lon); gc.DistanceToCenter = (long)gm.EllipsoidalDistance; gc.AngleToCenter = (int)gm.Azimuth.Degrees; }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { GAPPSF.Core.Data.Geocache gc = value as GAPPSF.Core.Data.Geocache; if (gc != null) { if (gc.ContainsCustomLatLon) { return(Utils.Conversion.GetCoordinatesPresentation((double)gc.CustomLat, (double)gc.CustomLon)); } else { return(Utils.Conversion.GetCoordinatesPresentation(gc.Lat, gc.Lon)); } } return(null); }
public static GeodeticMeasurement CalculateDistance(GAPPSF.Core.Data.Geocache gc, GAPPSF.Core.Data.Location loc) { return(CalculateDistance(gc.Lat, gc.Lon, loc.Lat, loc.Lon)); }