Send the language string to nominatim.
This commit is contained in:
parent
e19c04c7a7
commit
b3d37581ad
1 changed files with 2 additions and 2 deletions
|
@ -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|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue