Skip to content

Instantly share code, notes, and snippets.

@bogardpd
Created September 30, 2019 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bogardpd/f4a7f1f889c48f2f7ba0742478bcb59c to your computer and use it in GitHub Desktop.
Save bogardpd/f4a7f1f889c48f2f7ba0742478bcb59c to your computer and use it in GitHub Desktop.
/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