Skip to content

Instantly share code, notes, and snippets.

@bogardpd

bogardpd/map.rb

Created Sep 30, 2019
Embed
What would you like to do?
/app/classes/map.rb Waypoints (Airports)
#/app/classes/map.rb
def gpx_airports(airports)
airports = airports.sort_by{|a| @airport_details[a][:iata]}
return safe_join(airports.map{|a| gpx_airport(a, :wpt)})
end
def gpx_airport(airport_id, wpt_type)
detail = @airport_details[airport_id]
return content_tag(wpt_type, lat: detail[:latitude], lon: detail[:longitude]) do
concat content_tag(:name, detail[:iata] + " / " + detail[:icao])
concat content_tag(:description, detail[:city])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.