refactor: layer proxy mutation

This commit is contained in:
cha0s 2024-07-10 17:27:20 -05:00
parent 9f33e4df8a
commit 532792595a

View File

@ -13,6 +13,13 @@ class LayerProxy {
get area() {
return this.layer.area;
}
clone() {
const {$$sourceJson} = this.instance.$$layersProxies[this.index];
const proxy = new LayerProxy(this.instance, this.Component, this.index);
proxy.$$sourceJson = $$sourceJson;
return proxy;
}
get data() {
return this.layer.data;
}
@ -130,8 +137,7 @@ export default class TileLayers extends Component {
layers[layerIndex].data[calculated] = tile;
}
layers[layerIndex] = {...layers[layerIndex]};
component.$$layersProxies[layerIndex] = new LayerProxy(component, this, layerIndex);
await component.$$layersProxies[layerIndex].load();
component.$$layersProxies[layerIndex] = component.$$layersProxies[layerIndex].clone();
}
}
}