Permalink
Browse files

Adding KML show for individual points.

  • Loading branch information...
bamnet committed Jun 15, 2010
1 parent bb06668 commit fa7074f0cc9a279438d1d595468c5885899ab534
Showing with 14 additions and 0 deletions.
  1. +1 −0 app/controllers/points_controller.rb
  2. +13 −0 app/views/points/show.kml.builder
@@ -18,6 +18,7 @@ def show
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @point }
format.kml # show.kml.builder
end
end
@@ -0,0 +1,13 @@
xml = Builder::XmlMarkup.new(:indent => 2)
xml.instruct!
xml.kml(:xmlns => "http://www.opengis.net/kml/2.2") do
xml.Placemark(:id => @point.id) do
xml.name @point.name
xml.description do
xml.cdata! @point.description
end
xml.Point do
xml.coordinates "#{@point.longitude},#{@point.latitude}"
end
end
end

1 comment on commit fa7074f

@pdbradley

This comment has been minimized.

Show comment
Hide comment
@pdbradley

pdbradley Jan 16, 2011

This saved me hours. Much appreciated.

pdbradley commented on fa7074f Jan 16, 2011

This saved me hours. Much appreciated.

Please sign in to comment.