public void CanReverseGeoCodeAddressUnderDifferentCultures(string cultureName) { Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo(cultureName); Address[] addresses = geoCoder.ReverseGeocode(38.8976777, -77.036517).ToArray(); addresses[0].AssertWhiteHouseArea(); }
public SearchService() { _dishes = new MongoHelper<Dish>("dishes"); _users = new MongoHelper<User>("users"); _geocode = new GoogleGeoCoder(); //takes 2 parameters: //the current user given by the linq query ( selector ) //the address given by the user performing the search, instanciated as a Geocoding.Address type. //returns true if the distance between the current user selector and the given address is less than the distance scope, // otherwise, false. dishinmiles = (user, addressrequested) => { return _geocode .ReverseGeocode(user.Location.Coordinates[1], user.Location.Coordinates[0]) .FirstOrDefault() .DistanceBetween(addressrequested, DistanceUnits.Miles).Value < Scope; }; }
public void CanReverseGeoCode() { Address[] addresses = geoCoder.ReverseGeocode(38.8976777, -77.036517).ToArray(); addresses[0].AssertWhiteHouseArea(); }