From: Tom Hughes Date: Thu, 20 Dec 2007 10:33:25 +0000 (+0000) Subject: Third time lucky - what it really wants is a hash of node IDs... X-Git-Tag: live~8034 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/d6f6e4c7c1cab835b763b1171ea9ea774b70b8d7?ds=sidebyside Third time lucky - what it really wants is a hash of node IDs... --- diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index d7f47e5ec..e73e75fe7 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -103,14 +103,16 @@ class SearchController < ApplicationController nodes += Node.find(ways.collect { |w| w.nds }.uniq) # Print + visible_nodes = {} user_display_name_cache = {} doc = OSM::API.new.get_xml_doc nodes.each do |node| doc.root << node.to_xml_node(user_display_name_cache) + visible_nodes[node.id] = node end ways.each do |way| - doc.root << way.to_xml_node(nodes.collect { |n| n.id }, user_display_name_cache) + doc.root << way.to_xml_node(visible_nodes, user_display_name_cache) end relations.each do |rel|