1
0
Fork 0
fgdata/Nasal/canvas/map/WPT.scontroller
Philosopher f0d44ae8fe Lots lots more MapStructure changes
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.)
2014-05-25 14:27:11 -05:00

29 lines
666 B
Text

# See: http://wiki.flightgear.org/MapStructure
# Class things:
var name = 'WPT';
var parents = [Symbol.Controller];
var __self__ = caller(0)[0];
Symbol.Controller.add(name, __self__);
Symbol.registry[ name ].df_controller = __self__;
var last_idx = nil;
var new = func(symbol, model) {
var m = {
parents:[__self__],
listeners: [],
symbol: symbol,
model: model,
};
append(m.listeners, setlistener(symbol.layer.options.current_wp_node, func(n) {
var n = n.getValue();
if (m.last_idx == model.idx or n == model.idx)
symbol.update();
m.last_idx = n;
}, 0, 0));
return m;
}
var del = func() {
foreach (var l; me.listeners)
removelistener(l);
}