2014-04-29 02:26:32 +00:00
|
|
|
# See: http://wiki.flightgear.org/MapStructure
|
|
|
|
# Class things:
|
|
|
|
var name = 'APT';
|
|
|
|
var parents = [DotSym];
|
|
|
|
var __self__ = caller(0)[0];
|
|
|
|
DotSym.makeinstance( name, __self__ );
|
|
|
|
|
|
|
|
var element_type = "group"; # we want a group, becomes "me.element"
|
2014-05-25 18:11:13 +00:00
|
|
|
var icon_apt = nil;
|
|
|
|
var text_apt = nil;
|
2014-04-29 02:26:32 +00:00
|
|
|
|
|
|
|
# add the draw routine from airports-nd.draw here
|
2014-05-25 18:11:13 +00:00
|
|
|
var init = func {
|
|
|
|
var icon_apt = me.element.createChild("path", name ~ " icon" )
|
|
|
|
.moveTo(-17,0)
|
|
|
|
.arcSmallCW(17,17,0,34,0)
|
|
|
|
.arcSmallCW(17,17,0,-34,0)
|
2014-04-29 02:26:32 +00:00
|
|
|
.close()
|
2014-05-25 18:11:13 +00:00
|
|
|
.setColor(me.layer.style.color_default)
|
|
|
|
.setStrokeLineWidth(me.layer.style.line_width);
|
|
|
|
var text_apt = me.element.createChild("text", name ~ " label")
|
2014-04-29 02:26:32 +00:00
|
|
|
.setDrawMode( canvas.Text.TEXT )
|
2014-05-25 18:11:13 +00:00
|
|
|
.setTranslation(17,35)
|
2014-04-29 02:26:32 +00:00
|
|
|
.setText(me.model.id)
|
|
|
|
.setFont("LiberationFonts/LiberationSans-Regular.ttf")
|
2014-05-25 18:11:13 +00:00
|
|
|
.setColor(me.layer.style.label_font_color)
|
|
|
|
.setFontSize(me.layer.style.label_font_size);
|
|
|
|
|
|
|
|
# FIXME: this applies scale to the whole group, better do this separately for each element?
|
|
|
|
me.element.setScale(me.layer.style.scale_factor);
|
2014-04-29 02:26:32 +00:00
|
|
|
};
|
2014-05-25 18:11:13 +00:00
|
|
|
var draw = func;
|
2014-04-29 02:26:32 +00:00
|
|
|
|