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);
 }
Пример #2
0
 public Coordinate GetCoordinate()
 {
     if (!_store.HasLocation())
     {
         return(null);
     }
     return(new Coordinate(_store.GetLatitude(), _store.GetLongitude()));
 }
Пример #3
0
        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);
        }