Toggeling a layer now updates the view immediately
This commit is contained in:
parent
2c3c110624
commit
c4f0f18e5e
1 changed files with 2 additions and 2 deletions
|
@ -84,13 +84,13 @@ export default class FilteringFeatureSource implements FeatureSource {
|
||||||
layers.addCallback(update);
|
layers.addCallback(update);
|
||||||
|
|
||||||
const registered = new Set<UIEventSource<boolean>>();
|
const registered = new Set<UIEventSource<boolean>>();
|
||||||
layers.addCallback(layers => {
|
layers.addCallbackAndRun(layers => {
|
||||||
for (const layer of layers) {
|
for (const layer of layers) {
|
||||||
if(registered.has(layer.isDisplayed)){
|
if(registered.has(layer.isDisplayed)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
registered.add(layer.isDisplayed);
|
registered.add(layer.isDisplayed);
|
||||||
layer.isDisplayed.addCallback(update);
|
layer.isDisplayed.addCallback(() => update());
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue