1
0
Fork 0
fgdata/Nasal/canvas/map/airports-nd.draw
Philosopher 7ca8482b07 MapStructure work & (partial) integration
In time for 3.0. The API is still not fully complete, and not fully
cleaned up, but this is good enough for this release cycle (and it
should offer benefit longer term, if not now -- hopefully performance as
well).

Many thanks to Hooray as well, who has helped prepare things while I
could not, and often suggested ideas.
2014-01-09 21:24:22 -06: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
}