1
0
Fork 0
fgdata/Nasal/canvas/map/airports-nd.draw
Gijs de Rooy 573de77cb8 Navdisplay: bug fixed and new features
- Correct z-index
- Add MAP CTR compass
- Fix active WPT color
- Hide wind data at low speeds
- Move code outside main update loop
- Correct ranges
2014-07-06 23:17:47 +02:00

34 lines
1.1 KiB
Text

# WARNING: *.draw files will be deprecated, see: http://wiki.flightgear.org/MapStructure
##
# draws a single airport (ND style)
#
var draw_apt = func (group, apt, controller=nil, lod=0) {
var lat = apt.lat;
var lon = apt.lon;
var name = apt.id;
# print("drawing nd airport:", name);
var apt_grp = group.createChild("group", name);
# FIXME: conditions don't belong here, use the controller hash instead!
# if (1 or getprop("instrumentation/efis/inputs/arpt")) {
var icon_apt = apt_grp.createChild("path", name ~ " icon" )
.moveTo(-17,0)
.arcSmallCW(17,17,0,34,0)
.arcSmallCW(17,17,0,-34,0)
.close()
.setColor(0,0.6,0.85)
.setStrokeLineWidth(3);
var text_apt = apt_grp.createChild("text", name ~ " label")
.setDrawMode( canvas.Text.TEXT )
.setTranslation(17,35)
.setText(name)
.setFont("LiberationFonts/LiberationSans-Regular.ttf")
.setColor(0,0.6,0.85)
.setFontSize(28);
apt_grp.setGeoPosition(lat, lon)
.set("z-index",-1); # FIXME: this needs to be configurable!!
#}
# draw routines should always return their canvas group to the caller for further processing
}