Toggeling a layer now updates the view immediately

This commit is contained in:
pietervdvn 2021-03-14 01:53:37 +01:00
parent 2c3c110624
commit c4f0f18e5e

View file

@ -84,13 +84,13 @@ export default class FilteringFeatureSource implements FeatureSource {
layers.addCallback(update);
const registered = new Set<UIEventSource<boolean>>();
layers.addCallback(layers => {
layers.addCallbackAndRun(layers => {
for (const layer of layers) {
if(registered.has(layer.isDisplayed)){
continue;
}
registered.add(layer.isDisplayed);
layer.isDisplayed.addCallback(update);
layer.isDisplayed.addCallback(() => update());
}
})