]> git.openstreetmap.org Git - rails.git/blob - app/views/api/map.xml.builder
and the accompanying SWF
[rails.git] / app / views / api / map.xml.builder
1 # Note that this file is currently unused
2 # I (xin@zxv.ltd.uk) suspect this is slower than using OSM module, which in turn uses libxml
3 # it will be good to output xml this way eventually.
4 xml.instruct! :xml, :version=>"1.0"
5 xml.osm("version" => "0.5", "generator" => "OpenStreetMap Server") do
6   @nodes.each do |node|
7     xml.tag! "node",:id => node.id,
8                     :lat => node.lat,
9                     :lon => node.lon,
10                     :user => node.user_display_name,
11                     :visible => node.visible,
12                     :timestamp => node.timestamp.xmlschema  do
13       node.tags.each do |tag|
14         k,v = tag.split('=')
15         xml.tag! "tag",:k => k, :v => v
16       end
17     end
18   end
19   @ways.each do |way|
20     xml.tag! "way", :id => way.id,
21                     :user => way.user_display_name,
22                     :visible => way.visible,
23                     :timestamp => way.timestamp.xmlschema  do
24       way.nds.each do |nd|
25         xml.tag! "nd", :ref => nd
26       end
27
28     end
29       
30     
31   end
32 end