]> git.openstreetmap.org Git - rails.git/commitdiff
Third time lucky - what it really wants is a hash of node IDs...
authorTom Hughes <tom@compton.nu>
Thu, 20 Dec 2007 10:33:25 +0000 (10:33 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 20 Dec 2007 10:33:25 +0000 (10:33 +0000)
app/controllers/search_controller.rb

index d7f47e5ec187ff417f1f45440edc3475f282c240..e73e75fe76ce4f85f4127fc9e78cab969ccd97d6 100644 (file)
@@ -103,14 +103,16 @@ class SearchController < ApplicationController
     nodes += Node.find(ways.collect { |w| w.nds }.uniq)
 
     # Print
     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)
     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|
     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|
     end 
 
     relations.each do |rel|