Storing map config hierarchy to disk (e.g. as json)
If you programmatically create a map with model-, image-, and elevation layers based on user input from different UI elements, is there a convenient way of storing all the configs (MapOptions, ModelLayerOptions, FeatureModelSourceOptions, etc) as e.g. json (using Config::toJSON()) in a single config hierarchy so that the setup of the map can be stored and then reloaded in a later application session?
I have found ways to retrieve and store the different elements of the map config, but I wonder if there's a "smarter" way to store the whole config hierarchy than laboriously traversing through all the map layers, styles, sources etc to extract their config?