Created
September 30, 2019 01:01
-
-
Save bogardpd/f4a7f1f889c48f2f7ba0742478bcb59c to your computer and use it in GitHub Desktop.
/app/classes/map.rb Waypoints (Airports)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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