X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/424b6ef1cf760c4a3e27ac1e6f612ae42a9cd493..1801724c9e6117fe10503822d8a6a3cd99500e83:/lib/osm.rb diff --git a/lib/osm.rb b/lib/osm.rb index 40027991a..841cce17b 100644 --- a/lib/osm.rb +++ b/lib/osm.rb @@ -480,7 +480,7 @@ module OSM minlon = [(@lon - lonradius) * 180 / PI, -180].max maxlon = [(@lon + lonradius) * 180 / PI, 180].min - { :minlat => minlat, :maxlat => maxlat, :minlon => minlon, :maxlon => maxlon } + BoundingBox.new(minlon, minlat, maxlon, maxlat) end # get the SQL to use to calculate distance @@ -510,13 +510,13 @@ module OSM if ipinfo country = ipinfo.country_code2 else - country = http_client.get("http://api.hostip.info/country.php?ip=#{ip_address}").body + country = http_client.get("https://api.hostip.info/country.php?ip=#{ip_address}").body country = "GB" if country == "UK" end - return country + country rescue StandardError - return nil + nil end def self.ip_location(ip_address)