neomap
neomap copied to clipboard
Create / Update / Duplicate layer
Right now, we always have "Create New Layer" and "Update Layer" buttons displayed.
We should move to something like:
- If layer has never been rendered: "Create New Layer"
- If the layer has already been rendered: "Update Layer", "Duplicate Layer"
@jodom , what do you think?
Besides store to file, we currently don't persist layers beyond sessions. As such we don't have a clear signal for layer having been rendered/not
Starting from one layer spec with selected data points, and visual specs like name, line thickness, heatmap radius e.t.c what does it mean to create a new layer? 'Update Layer' clearly is the user is overriding already declared spec including selected data on a layer. 'Duplicate Layer' makes sense if I don't change any of the layer specs besides name. 'Create New Layer' is generic, starting off with some declared spec on a layer (existing / absolutely new), and could result in a duplication of layer (except for name + unique id)
Do we also want to start persisting layers outside app state. For example in some weak storage like session storage which we can clear when app is closed? This is not necessary, but makes sense if we see a lot of use of store-to-file functionality
To get the "already rendered" information, we can just update the layer's state the first time the "Create" button is clicked. "Create" means "Add to map" in my mind. Once the layer is already on the map, then we can "Update" it.