From a7f00eefc4842a87c9076cac8b70fab5149a732b Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sat, 25 Aug 2007 22:33:46 +0000 Subject: [PATCH] Correct calculation of reciprocal angles. --- app/controllers/geocoder_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/geocoder_controller.rb b/app/controllers/geocoder_controller.rb index 4ed94b649..8abcbdc44 100644 --- a/app/controllers/geocoder_controller.rb +++ b/app/controllers/geocoder_controller.rb @@ -185,7 +185,7 @@ private name = named.attributes["name"].to_s description = named.elements["description"].to_s distance = format_distance(place.attributes["approxdistance"].to_i) - direction = format_direction(360 - place.attributes["direction"].to_i) + direction = format_direction((place.attributes["direction"].to_i - 180) % 360) prefix = "#{distance} #{direction} of #{type} " results.push({:lat => lat, :lon => lon, :zoom => zoom, :prefix => prefix.capitalize, :name => name, -- 2.43.2