public static double CalculateDestination(this Overture.ServiceModel.Customers.Stores.Store store, Coordinate searchPoint) { return(store.HasLocation() ? Math.Round(GeoCodeCalculator.CalcDistance(store.GetLatitude(), store.GetLongitude(), searchPoint.Lat, searchPoint.Lng, EarthRadiusMeasurement.Kilometers), 2) : double.MaxValue); }
public Coordinate GetCoordinate() { if (!_store.HasLocation()) { return(null); } return(new Coordinate(_store.GetLatitude(), _store.GetLongitude())); }
public static double CalculateDestination(this Overture.ServiceModel.Customers.Stores.Store store, Coordinate searchPoint, LengthMeasureUnitEnum lengthMeasureUnit) { double radius = lengthMeasureUnit == LengthMeasureUnitEnum.km ? EarthRadiusMeasurement.Kilometers : EarthRadiusMeasurement.Miles; return(store.HasLocation() ? Math.Round(GeoCodeCalculator.CalcDistance(store.GetLatitude(), store.GetLongitude(), searchPoint.Lat, searchPoint.Lng, radius), 2) : double.MaxValue); }