1
0
Fork 0
fgdata/Nasal/canvas/map/airport-nd.draw
Gijs de Rooy a9576e8c8d Canvas Navigational Display:
- get rid of global variables and use instance variables
- identified all important drawing routines and move them into *.draw files
- changed to dynamic loading of *.draw *.model and *.layer files
- implemented poor-man's controller hash to move use-case specific conditionals out of the draw files, and back into the instantiation, i.e. Gijs' EFIS class
- started identifying stuff that is not specific to drawing, but to what is to be drawn, i.e. Model stuff - such as positioned queries, moved those out into *.model files
- some more work on supporting more than a single ND MFD instance per aircraft
- renamed a handful of SVG identifiers to avoid naming conflicts and to simplify usage of SVG IDs as member fields
- moved all of the setlistener setup out of the fdm-initialized stub right into the ctor of the Efis class (actually that's controller stuff...)
- initial MapStructure framework
- aircraft-agnostic NavDisplay class
- preparations for deprecating map.nas
- additions to canvas.map
- preparations for making NDStyles configurable via XML
2013-12-01 13:36:23 +01:00

33 lines
1 KiB
Text

##
# 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
}