]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/geocoder_controller.rb
Change abilities based on upstream renamings
[rails.git] / app / controllers / geocoder_controller.rb
index 3431fb8d3f8007035abf255136819df2f8ebfec6..da5245687f73db3fb97871fac05a47876420f017 100644 (file)
@@ -49,6 +49,7 @@ class GeocoderController < ApplicationController
                       :zoom => params[:zoom],
                       :name => "#{lat}, #{lon}")
       end
+
       if lon >= -90 && lon <= 90 && lat >= -180 && lat <= 180
         @results.push(:lat => lon, :lon => lat,
                       :zoom => params[:zoom],
@@ -61,7 +62,6 @@ class GeocoderController < ApplicationController
       else
         render :action => "results"
       end
-
     else
       # Coordinates in a query have come with markers for latitude and longitude.
       if lat < -90 || lat > 90
@@ -305,7 +305,9 @@ class GeocoderController < ApplicationController
         params.merge!(dms_to_decdeg(latlon)).delete(:query)
 
       elsif latlon = query.match(/^\s*([+-]?\d+(\.\d*)?)\s*[\s,]\s*([+-]?\d+(\.\d*)?)\s*$/)
-        params.merge!(:lat => latlon[1].to_f, :lon => latlon[3].to_f, :latlon_digits => true).delete(:query)
+        params.merge!(:lat => latlon[1].to_f, :lon => latlon[3].to_f).delete(:query)
+
+        params[:latlon_digits] = true unless params[:whereami]
       end
     end