Canvas Map API: Difference between revisions

Jump to navigation Jump to search
1,400 bytes removed ,  26 June 2014
m
m (→‎Adding support for new Layer Types: removing stuff that should no longer be documented/used due to MapStructure)
Line 197: Line 197:
map.cleanup_listeners();  
map.cleanup_listeners();  
</syntaxhighlight>
</syntaxhighlight>
== How the whole thing works ==
This is targeted at people who are interested in helping improve the whole thing, so that they get a better understanding of how the whole thing hangs together at the moment.
For the time being, the implementation is specific to GUI dialogs - in that it will largely simplify (and even automate) the creation of GUI dialogs with an embedded canvas "map". This is accomplished using a handful of fixed assumptions, most of which will need to be addressed in order to support additional dialogs, and eventually, also non-GUI, i.e. instrument-use. Namely, that means:
* that people can simply instantiate a "GenericMap" by including an existing XML file
* dialog-specific settings can be overridden and customized (see above, or [[$FG_ROOT]]/gui/dialogs/airports.xml) - i.e. just copied/pasted
* the GenericMap is a LayeredMap where layers are created for different features and linked to toggle properties
* there are a handful of variables/functions that need to be declared in the body of the dialog's Nasal/open block
* in addition, 1-2 function calls need to be made during initialization, in the Nasal/OPEN section
* these are later on used by the system to instantiate all requested layers dynamically
* first of all, this is the "setupGUI" function, which will create the requested layers, and add GUI checkboxes and zoom buttons to the dialog automatically


== Also see ==
== Also see ==
* http://forum.flightgear.org/viewtopic.php?f=71&t=21139
* http://forum.flightgear.org/viewtopic.php?f=71&t=21139

Navigation menu