2014-04-29 02:26:32 +00:00
|
|
|
# WARNING: *.draw files will be deprecated, see: http://wiki.flightgear.org/MapStructure
|
2013-12-01 12:29:22 +00:00
|
|
|
##
|
|
|
|
# Draw a waypoint symbol and waypoint name (Gijs' 744 ND.nas code)
|
|
|
|
|
|
|
|
#
|
2013-12-28 15:18:35 +00:00
|
|
|
var drawwp = func (group, lat, lon, alt, name, i, wp) {
|
2013-12-01 12:29:22 +00:00
|
|
|
var wp_group = group.createChild("group","wp");
|
|
|
|
wp[i] = wp_group.createChild("path", "wp-" ~ i)
|
|
|
|
.setStrokeLineWidth(3)
|
|
|
|
.moveTo(0,-25)
|
|
|
|
.lineTo(-5,-5)
|
|
|
|
.lineTo(-25,0)
|
|
|
|
.lineTo(-5,5)
|
|
|
|
.lineTo(0,25)
|
|
|
|
.lineTo(5,5)
|
|
|
|
.lineTo(25,0)
|
|
|
|
.lineTo(5,-5)
|
|
|
|
.setColor(1,1,1)
|
|
|
|
.close();
|
|
|
|
#####
|
|
|
|
# The commented code leads to a segfault when a route is replaced by a new one
|
|
|
|
#####
|
|
|
|
#
|
|
|
|
# text_wp[i] = wp_group.createChild("text", "wp-text-" ~ i)
|
|
|
|
#
|
2014-07-08 10:28:26 +00:00
|
|
|
if (alt != 0)
|
|
|
|
name ~= "\n"~alt;
|
2013-12-01 12:29:22 +00:00
|
|
|
var text_wps = wp_group.createChild("text", "wp-text-" ~ i)
|
|
|
|
.setDrawMode( canvas.Text.TEXT )
|
2014-07-08 10:28:26 +00:00
|
|
|
.setText(name)
|
2013-12-01 12:29:22 +00:00
|
|
|
.setFont("LiberationFonts/LiberationSans-Regular.ttf")
|
|
|
|
.setFontSize(28)
|
|
|
|
.setTranslation(25,35)
|
2013-12-28 15:18:35 +00:00
|
|
|
.setColor(1,1,1);
|
2014-07-08 10:28:26 +00:00
|
|
|
wp_group.setGeoPosition(lat, lon);
|
2013-12-01 12:29:22 +00:00
|
|
|
};
|