I am trying to attempt to swap .earth files during runtime via a function call. Whether than be via a keypress or something else. I have been coopting the command line arguments to work with our own software but the main thing here is just the .earth itself. Nothing else should need to change.
Right now this is how I am initializing everything currently:
MapNodeHelper exists specifically to support the osgEarth samples (which is why it lives in the ExampleResources header). If you building a custom app we would usually recommend writing your own code - you can refer to MapNodeHelper for example code that you really need in your own app.
If you still want to use it, yes, you can load .earth files with a simple osgDB::readRefNodeFile call, and you can call MapNodeHelper::parse or ::configureView directly and pass in a nullptr if you are not using Controls.
On a side note, we are no longer maintaining the Controls library moving as of version 3.2. It won't go away but we will focus on ImGui in the future. -gw