anvaka / city-roads

Visualization of all roads within any city
https://anvaka.github.io/city-roads/
MIT License
6k stars 444 forks source link

Possible to export/save settings for re-rendering later? #50

Open linjmeyer opened 3 years ago

linjmeyer commented 3 years ago

Hi there! I was wondering if there was a quick way to export the settings (layers?) as a JSON file or some other format. General idea would be to re-use this file in the future to re-render and adjust the settings as needed.

I can export as an image currently which is great but if I need to tweak the visuals or settings layer I will have to recreate it again.

Thanks, this is a very cool project!

linjmeyer commented 3 years ago

First attempt was this:

var test = scene.queryLayerAll(); JSON.stringify(test);

VM6296:1 Uncaught TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'WireCollection'
    |     property 'parent' -> object with constructor 'Element'
    |     property 'children' -> object with constructor 'Array'
    --- index 0 closes the circle
    at JSON.stringify (<anonymous>)
    at <anonymous>:1:40