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
|
|
|
|
|
|
|
var draw_rwy_nd = func (group, rwy, controller=nil, lod=nil) {
|
|
|
|
# print("drawing runways-nd");
|
2014-07-08 10:28:26 +00:00
|
|
|
canvas._draw_rwy_nd(group,rwy.lat,rwy.lon,rwy.length,rwy.width,rwy.heading,rwy.id);
|
2013-12-01 12:29:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
# TODO: this is not yet a real draw callback ... (wrong signature, not yet integrated)
|
|
|
|
|
2014-07-08 10:28:26 +00:00
|
|
|
var _draw_rwy_nd = func (group, lat, lon, length, width, rwyhdg, id) {
|
2013-12-01 12:29:22 +00:00
|
|
|
var apt = airportinfo("EHAM");
|
|
|
|
var rwy = apt.runway("18R");
|
|
|
|
|
|
|
|
var crds = [];
|
|
|
|
var coord = geo.Coord.new();
|
|
|
|
width=width*20; # Else rwy is too thin to be visible
|
|
|
|
coord.set_latlon(lat, lon);
|
|
|
|
coord.apply_course_distance(rwyhdg, -14.2*NM2M);
|
|
|
|
append(crds,"N"~coord.lat());
|
|
|
|
append(crds,"E"~coord.lon());
|
|
|
|
coord.apply_course_distance(rwyhdg, 28.4*NM2M+length);
|
|
|
|
append(crds,"N"~coord.lat());
|
|
|
|
append(crds,"E"~coord.lon());
|
|
|
|
icon_rwy = group.createChild("path", "rwy-cl")
|
|
|
|
.setStrokeLineWidth(3)
|
|
|
|
.setDataGeo([2,4],crds)
|
|
|
|
.setColor(1,1,1)
|
|
|
|
.setStrokeDashArray([10, 20, 10, 20, 10]);
|
|
|
|
var crds = [];
|
|
|
|
coord.set_latlon(lat, lon);
|
|
|
|
coord.apply_course_distance(rwyhdg + 90, width/2);
|
|
|
|
append(crds,"N"~coord.lat());
|
|
|
|
append(crds,"E"~coord.lon());
|
|
|
|
coord.apply_course_distance(rwyhdg, length);
|
|
|
|
append(crds,"N"~coord.lat());
|
|
|
|
append(crds,"E"~coord.lon());
|
|
|
|
icon_rwy = group.createChild("path", "rwy")
|
|
|
|
.setStrokeLineWidth(3)
|
|
|
|
.setDataGeo([2,4],crds)
|
|
|
|
.setColor(1,1,1);
|
|
|
|
var crds = [];
|
|
|
|
coord.apply_course_distance(rwyhdg - 90, width);
|
|
|
|
append(crds,"N"~coord.lat());
|
|
|
|
append(crds,"E"~coord.lon());
|
|
|
|
coord.apply_course_distance(rwyhdg, -length);
|
|
|
|
append(crds,"N"~coord.lat());
|
|
|
|
append(crds,"E"~coord.lon());
|
|
|
|
icon_rwy = group.createChild("path", "rwy")
|
|
|
|
.setStrokeLineWidth(3)
|
|
|
|
.setDataGeo([2,4],crds)
|
|
|
|
.setColor(1,1,1);
|
2014-07-08 10:28:26 +00:00
|
|
|
group.createChild("text", "rwy-text")
|
|
|
|
.setDrawMode( canvas.Text.TEXT )
|
|
|
|
.setText(id)
|
|
|
|
.setFont("LiberationFonts/LiberationSans-Regular.ttf")
|
|
|
|
.setFontSize(28)
|
|
|
|
.setTranslation(35,0)
|
2014-07-12 15:56:48 +00:00
|
|
|
.setColor(1,1,1);
|
2013-12-01 12:29:22 +00:00
|
|
|
}
|