Closed stellasia closed 3 years ago
Maybe related: the "Delete" button does not appear.
@stellasia is it about master_dev
branch?
if so it is easy to fix: new layer is created with a copy of current layer's state. we just need to replace it with default state
createLayer = async () => {
await this.updateData();
const proposedLayer = {...this.state};
// Generate new ukey
proposedLayer.ukey = generateUkeyFromName(proposedLayer.name);
this.props.addLayer(proposedLayer);
}
https://github.com/stellasia/neomap/blob/master_dev/src/components/Layer.js#L312
That was a bit more complicated than that, actually new layer was created with a default "ukey", which was causing troubles used in combination with a useMemo hook (at least, this is my understanding). Fixed in https://github.com/stellasia/neomap/commit/1437bdd30297e3c924ff1b1cfc254d0410fe24d7 with several other bugs, such that master_dev is not in much better shape :) I'll do more tests this week and merge it with master over the week-end, so that we can restart working from there.
This is very confusing, after creating a layer, I end up with:
I don't which layer is the "new" one. New layers should be created from the default layer configuration.
Hint: is that related to: https://github.com/stellasia/neomap/blob/master/src/components/Layer.js#L310 ?