@sources.push "osm_nominatim"
@sources.push "geonames"
end
-
- render :update do |page|
- page.replace_html :sidebar_content, :partial => "search"
- page.call "openSidebar"
- end
end
def search_latlon
end
# ask nominatim
- response = fetch_xml("http://nominatim.openstreetmap.org/search?format=xml&q=#{escape_query(query)}#{viewbox}#{exclude}&accept-language=#{request.user_preferred_languages.join(',')}")
+ response = fetch_xml("#{NOMINATIM_URL}search?format=xml&q=#{escape_query(query)}#{viewbox}#{exclude}&accept-language=#{request.user_preferred_languages.join(',')}")
# create result array
@results = Array.new
end
render :action => "results"
- rescue Exception => ex
- @error = "Error contacting nominatim.openstreetmap.org: #{ex.to_s}"
- render :action => "error"
+# rescue Exception => ex
+# @error = "Error contacting nominatim.openstreetmap.org: #{ex.to_s}"
+# render :action => "error"
end
def search_geonames
@sources.push({ :name => "osm_nominatim" })
@sources.push({ :name => "geonames" })
-
- render :update do |page|
- page.replace_html :sidebar_content, :partial => "description"
- page.call "openSidebar"
- end
end
def description_osm_namefinder
@results = Array.new
# ask OSM namefinder
- response = fetch_xml("http://nominatim.openstreetmap.org/reverse?lat=#{lat}&lon=#{lon}&zoom=#{zoom}&accept-language=#{request.user_preferred_languages.join(',')}")
+ response = fetch_xml("#{NOMINATIM_URL}reverse?lat=#{lat}&lon=#{lon}&zoom=#{zoom}&accept-language=#{request.user_preferred_languages.join(',')}")
# parse the response
response.elements.each("reversegeocode/result") do |result|