Send the language string to nominatim.

This commit is contained in:
Tom Hughes 2009-11-10 15:05:23 +00:00
parent e19c04c7a7
commit b3d37581ad

View file

@ -232,7 +232,7 @@ class GeocoderController < ApplicationController
@results = Array.new @results = Array.new
# ask nominatim # ask nominatim
response = fetch_xml("http://nominatim.openstreetmap.org/search?format=xml&q=#{escape_query(query)}#{viewbox}") response = fetch_xml("http://nominatim.openstreetmap.org/search?format=xml&q=#{escape_query(query)}#{viewbox}&accept-language=#{request.user_preferred_languages.join(',')}")
# parse the response # parse the response
response.elements.each("searchresults/place") do |place| response.elements.each("searchresults/place") do |place|
@ -350,7 +350,7 @@ class GeocoderController < ApplicationController
@results = Array.new @results = Array.new
# ask OSM namefinder # ask OSM namefinder
response = fetch_xml("http://nominatim.openstreetmap.org/reverse?lat=#{lat}&lon=#{lon}&zoom=#{zoom}") response = fetch_xml("http://nominatim.openstreetmap.org/reverse?lat=#{lat}&lon=#{lon}&zoom=#{zoom}&accept-language=#{request.user_preferred_languages.join(',')}")
# parse the response # parse the response
response.elements.each("reversegeocode") do |result| response.elements.each("reversegeocode") do |result|