Skip to content

Instantly share code, notes, and snippets.

@bogardpd
Created Sep 30, 2019
Embed
What would you like to do?
/app/classes/map.rb Completing the kml method
#/app/classes/map.rb
def kml
@airport_details ||= airport_details
used_airports = @airport_details.keys
output = %Q(<?xml version="1.0" encoding="UTF-8" ?>).html_safe
output += content_tag(:kml, xmlns: "http://www.opengis.net/kml/2.2") do
content_tag(:Document) do
concat content_tag(:name, map_name)
concat content_tag(:description, map_description)
concat kml_styles
concat kml_airports(used_airports)
concat kml_routes(routes_normal | routes_out_of_region, "Routes")
concat kml_routes(routes_highlighted, "Highlighted Routes")
concat kml_routes(routes_unhighlighted, "Unhighlighted Routes")
end
end
return output
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment