Canvas Scripting Layer (Mapping):
authorHooray <hooray@hush.com>
Thu, 20 Sep 2012 23:49:17 +0000 (01:49 +0200)
committerStuart Buchanan <stuart_d_buchanan@yahoo.co.uk>
Sat, 29 Sep 2012 20:16:31 +0000 (21:16 +0100)
commit3f3dc9fef25b6bf94666c0fb8d536a8be6cbcb26
treeb9275ebb236d457447c82f61c3c5048dd1ef2f84
parent1f1214517c82902ec781ae2c05c66b8d741b70fe
Canvas Scripting Layer (Mapping):

- first stab at refactoring the map.nas module, and trying to let the API evolve according to our requirements
- split up the module into separate files (some of them will disappear soon)
- split up the "drawing" loops into separate functions so that they can be individually called
- move actual "drawing" to map_layers.nas
- introduce some OOP helpers to prepare a pure Layer-based design
- prepare helpers: LayeredMap, GenericMap, AirportMap (TODO: use a real "Layer" class)
- move airport features (taxiways, runways, parking, tower) to separate layers (i.e. canvas groups)
- avoid using a single update callback and use different layer-specific callbacks to update individual layers more efficiently
- add some boilerplate hashes to prepare the MVC design
- allow lazy updating of layers, where canvas groups are only populated on demand, to save some time during instantiation, i.e. loading an airport without "parking" selected, will only populate the layer once the checkbox is checked
- extend the original code such that it supports showing multiple airports at once
- add some proof of concept "navaid" layer using SVG files for navaid symbols (added only NDB symbol from wikimedia commons)

regressions:
- runway highlighting needs to be re-implemented
- parking highlighting will be done differently
- enforcing a specific drawing order for layers is currently not explicitly supported, so that taxiways may be rendered on top of runways

Also:

- integrated with the latest changes in git/master (HEAD) -i.e. metar support
- further generalized map.nas
- partially moved instantiation from Nasal space to XML space (WIP)
- create "toggle layer" checkboxes procedurally in Nasal space
- prepared the code to be better reusable in other dialogs (e.g. route manager, map dialog etc)
- completely removed the "highlighting" (runway/parking) feature for now, because we talked about re-implementing it anyhow
23 files changed:
Nasal/canvas/PropertyElement.nas
Nasal/canvas/api.nas
Nasal/canvas/design.txt [new file with mode: 0644]
Nasal/canvas/generic-canvas-map.xml [new file with mode: 0644]
Nasal/canvas/map.nas
Nasal/canvas/map/README.txt [new file with mode: 0644]
Nasal/canvas/map/airports.model [new file with mode: 0644]
Nasal/canvas/map/fixes.model [new file with mode: 0644]
Nasal/canvas/map/navaid.draw [new file with mode: 0644]
Nasal/canvas/map/navaids.layer [new file with mode: 0644]
Nasal/canvas/map/navaids.model [new file with mode: 0644]
Nasal/canvas/map/parking.draw [new file with mode: 0644]
Nasal/canvas/map/parking.layer [new file with mode: 0644]
Nasal/canvas/map/runways.draw [new file with mode: 0644]
Nasal/canvas/map/runways.layer [new file with mode: 0644]
Nasal/canvas/map/taxiways.draw [new file with mode: 0644]
Nasal/canvas/map/taxiways.layer [new file with mode: 0644]
Nasal/canvas/map/test.layer [new file with mode: 0644]
Nasal/canvas/map/tower.draw [new file with mode: 0644]
Nasal/canvas/map/tower.layer [new file with mode: 0644]
Nasal/canvas/map/waypoints.model [new file with mode: 0644]
gui/dialogs/airports.xml
gui/dialogs/images/ndb_symbol.svg [new file with mode: 0644]