Quantcast

Storing map config hierarchy to disk (e.g. as json)

classic Classic list List threaded Threaded
3 messages Options
John Larring John Larring
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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?

Thanks in advance,
John
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Storing map config hierarchy to disk (e.g. as json)

John,
You can call osgDB::writeNodeFile(mapNode, filename_or_ostream) to store an XML earth file.
Glenn Waldron / Pelican Mapping / @glennwaldron
John Larring John Larring
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Storing map config hierarchy to disk (e.g. as json)

Thanks Glenn! Exactly what I was looking for :-)
Loading...