@sources.push "osm_nominatim"
else
@sources.push "osm_nominatim"
- @sources.push "geonames"
- end
-
- render :update do |page|
- page.replace_html :sidebar_content, :partial => "search"
- page.call "openSidebar"
+ @sources.push "geonames" if defined?(GEONAMES_USERNAME)
end
end
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
@results = Array.new
# ask geonames.org
- response = fetch_xml("http://ws.geonames.org/search?q=#{escape_query(query)}&maxRows=20")
+ response = fetch_xml("http://api.geonames.org/search?q=#{escape_query(query)}&maxRows=20&username=#{GEONAMES_USERNAME}")
# parse the response
response.elements.each("geonames/geoname") do |geoname|
@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