Canvas ND framework: Difference between revisions

Jump to navigation Jump to search
m
mNo edit summary
Line 270: Line 270:
<syntaxhighlight lang="nasal">
<syntaxhighlight lang="nasal">
{ name:'AA', isMapStructure:1, update_on:['toggle_range','toggle_display_mode'],
{ name:'AA', isMapStructure:1, update_on:['toggle_range','toggle_display_mode'],
                                predicate: func(nd, layer) {
predicate: func(nd, layer) {
                                        # toggle visibility here
# toggle visibility here
                                        var visible=nd.in_mode('toggle_display_mode', ['MAP']);
var visible=nd.in_mode('toggle_display_mode', ['MAP']);
                                        layer.group.setVisible( visible );
layer.group.setVisible( visible );
                                        if (visible) {
if (visible) {
                                                #print("Updating MapStructure ND layer: AA");
  #print("Updating MapStructure ND layer: AA");
                                                layer.update();
  layer.update();
                                        }
}
                                }, # end of layer update predicate
}, # end of layer update predicate
                                'z-index': 1,
'z-index': 1,
                        }, # end of AA layer
}, # end of AA layer
</syntaxhighlight>
</syntaxhighlight>


Navigation menu