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.)
23 lines
905 B
Text
23 lines
905 B
Text
# See: http://wiki.flightgear.org/MapStructure
|
|
# Class things:
|
|
var name = 'WXR'; # storms/weather layer for LW/AW (use thunderstom scenario for testing)
|
|
var parents = [DotSym];
|
|
var __self__ = caller(0)[0];
|
|
DotSym.makeinstance( name, __self__ );
|
|
|
|
var element_type = "group"; # we want a group, becomes "me.element"
|
|
|
|
# TODO: how to integrate both styling and caching?
|
|
var draw = func {
|
|
# TODO: once this works properly, consider using caching here
|
|
# FIXME: scaling seems way off in comparison with the navdisplay - i.e. hard-coded assumptions about texture size/view port ?
|
|
me.element.createChild("image")
|
|
.setFile("Nasal/canvas/map/Images/storm.png")
|
|
.setSize(128*me.model.radiusNm,128*me.model.radiusNm)
|
|
.setTranslation(-64*me.model.radiusNm,-64*me.model.radiusNm)
|
|
.setCenter(0,0);
|
|
# .setScale(0.3);
|
|
# TODO: overlapping storms should probably set their z-index according to altitudes
|
|
|
|
};
|
|
|