f0d44ae8fe
Fix the main bugs, add features and convert most of the layers. Move/refactor some things as well. Add a canvas map dialog next to the built-in one -- it's not 100% functional but it's quite close actually. As before, the excitement has been taking place at our team clone. https://gitorious.org/fg/canvas-hackers-fgdata/commits/0b4cc84 (topics/canvas-map-dialog branch this time, current HEAD in above URL.)
33 lines
1 KiB
Text
33 lines
1 KiB
Text
# 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"
|
|
var icon_apt = nil;
|
|
var text_apt = nil;
|
|
|
|
# add the draw routine from airports-nd.draw here
|
|
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)
|
|
.close()
|
|
.setColor(me.layer.style.color_default)
|
|
.setStrokeLineWidth(me.layer.style.line_width);
|
|
var text_apt = me.element.createChild("text", name ~ " label")
|
|
.setDrawMode( canvas.Text.TEXT )
|
|
.setTranslation(17,35)
|
|
.setText(me.model.id)
|
|
.setFont("LiberationFonts/LiberationSans-Regular.ttf")
|
|
.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);
|
|
};
|
|
var draw = func;
|
|
|