added experimental xml template which is not yet used due to performance issues
This commit is contained in:
parent
63e0486ca1
commit
6b23aa550e
1 changed files with 32 additions and 0 deletions
32
app/views/api/map.rxml
Normal file
32
app/views/api/map.rxml
Normal file
|
@ -0,0 +1,32 @@
|
|||
# Note that this file is currently unused
|
||||
# I (xin@zxv.ltd.uk) suspect this is slower than using OSM module, which in turn uses libxml
|
||||
# it will be good to output xml this way eventually.
|
||||
xml.instruct! :xml, :version=>"1.0"
|
||||
xml.osm("version" => "0.5", "generator" => "OpenStreetMap Server") do
|
||||
@nodes.each do |node|
|
||||
xml.tag! "node",:id => node.id,
|
||||
:lat => node.lat,
|
||||
:lon => node.lon,
|
||||
:user => node.user_display_name,
|
||||
:visible => node.visible,
|
||||
:timestamp => node.timestamp.xmlschema do
|
||||
node.tags.each do |tag|
|
||||
k,v = tag.split('=')
|
||||
xml.tag! "tag",:k => k, :v => v
|
||||
end
|
||||
end
|
||||
end
|
||||
@ways.each do |way|
|
||||
xml.tag! "way", :id => way.id,
|
||||
:user => way.user_display_name,
|
||||
:visible => way.visible,
|
||||
:timestamp => way.timestamp.xmlschema do
|
||||
way.nds.each do |nd|
|
||||
xml.tag! "nd", :ref => nd
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue