This repository has been archived on 2021-09-26. You can view files and clone it, but cannot push or open issues or pull requests.
IDG-A32X/Models/Instruments/ND/canvas/map/RTE.symbol
2017-06-18 20:14:41 -04:00

46 lines
1.1 KiB
Text

# See: http://wiki.flightgear.org/MapStructure
# Class things:
var name = 'RTE';
var parents = [LineSymbol];
var __self__ = caller(0)[0];
LineSymbol.makeinstance( name, __self__ );
SymbolLayer.get(name).df_style = { # style to use by default
line_width: 5,
color: [1,0,1]
};
var getLineStyle = func(property, df_val){
var type = nil;
if(typeof(me.model) == 'hash'){
type = me.model.type;
}
if(type != nil and type != 'active'){
var base_prop = property;
property = property~'_'~type;
me.getStyle(property, me.getStyle(base_prop, df_val));
} else {
me.getStyle(property, df_val);
}
};
var setRouteStyle = func{
var df_style = SymbolLayer.get(name).df_style;
var dash = me.getLineStyle('line_dash', []);
var color = me.getLineStyle('color', df_style.color);
var line_width = me.getLineStyle('line_width', df_style.line_width);
me.element.setColor(color)
.setStrokeLineWidth(line_width);
if(typeof(dash) == 'vector')
me.element.setStrokeDashArray(dash);
};
var init = func {
me.setRouteStyle();
};
#var draw = func {
# me.setRouteStyle();
#};