Okay, according to the latest commits, Stuart has already implemented a number of the ideas discussed here, so I won't need to send my patch for review
However, even apart from the previously mentioned "leaking" vector data (after multiple subsequent airport lookups), there's still the issue of the updateZoom() callback being non-conditionally invoked via settimer(), so that it will never stop - it needs to be fixed to be terminated via a signal, or simply use the loopid method - otherwise, there will be more and more timers running, even after the dialog got closed.
Overall, I feel we should move such implementation details to helpers in map.nas - because GUI handling will probably be later on re-implemented using the new events subsystem. Otherwise, it is too easy for people to forget that timer callbacks need to properly terminated and listeners manually de-registered.
This is one of those cases were copy/paste errors propagate far too easily, even though they may already be fixed in the original place - which is why we should have a well localized place for such helpers, so that they don't develop their own "dynamics"
Personally, I'd suggest to add a helper hash "Map" with a handful of methods to help create new maps:
- new
- addLayer
- setRef
- setHdg
- setZoomRanges
- setZoomLevel
that should make it possible to implement most standard helpers as methods within the map.nas module