20,741
edits
(→Map) |
(→Map) |
||
Line 191: | Line 191: | ||
{{WIP}} | {{WIP}} | ||
Assuming, we have access to a root group, the most minimal snippet of code to display a layered MapStructure map is the following: | |||
<syntaxhighlight lang="nasal"> | <syntaxhighlight lang="nasal"> | ||
var TestMap = root.createChild("map"); | |||
TestMap.setController("Aircraft position"); | |||
TestMap.setRange(25); | |||
TestMap.setTranslation(width, height); | |||
var r = func(name,vis=1,zindex=nil) return caller(0)[0]; | |||
foreach(var type; [r('VOR'),r('APT'), r('APS') ] ) | |||
TestMap.addLayer(factory: canvas.SymbolLayer, type_arg: type.name, visible: type.vis, priority: type.zindex,); | |||
</syntaxhighlight> | </syntaxhighlight> | ||