X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/24d535237c6023d7c61468ab5c756a38896ff242..bc8ce5729da0a7df4306ae5f785f68980a9bf47b:/app/controllers/geocoder_controller.rb diff --git a/app/controllers/geocoder_controller.rb b/app/controllers/geocoder_controller.rb index 4a593f86a..8ec0ab6b7 100644 --- a/app/controllers/geocoder_controller.rb +++ b/app/controllers/geocoder_controller.rb @@ -218,10 +218,10 @@ class GeocoderController < ApplicationController query.match(/^(\d{1,3})°?\s*(\d{1,2})['′]?(?:\s*(\d{1,3}(\.\d*)?)?["″]?)?\s*([NS])\W*(\d{1,3})°?\s*(\d{1,2})['′]?(?:\s*(\d{1,3}(\.\d*)?)?["″]?)?\s*([EW])$/).try(:captures) # degrees, minutes, decimal seconds [NSEW] params.merge!(dms_to_decdeg(latlon)).delete(:query) - elsif latlon = query.match(/^([+-]?\d+(\.\d*)?)(?:\s+|\s*,\s*)([+-]?\d+(\.\d*)?)$/) + elsif latlon = query.match(%r{^([+-]?\d+(\.\d*)?)(?:\s+|\s*[,/]\s*)([+-]?\d+(\.\d*)?)$}) params.merge!(:lat => latlon[1].to_f, :lon => latlon[3].to_f).delete(:query) - params[:latlon_digits] = true unless params[:whereami] + params[:latlon_digits] = true end end