Rune (svelte5) for Reactive Layers Filter #266
-
|
I would like to set up a "reactive" layer filter based on a $derived state, to dynamically filter some of my source data on User interaction. I'm basically doing the following: assuming When I inspect ( My idea is to then call this The results are really strange. It seems to work intermittently, but it's definitely not reactive. Sometimes it works when I refresh my page, and other times it stops working altogether. I've also tried with As I'm new to the Also as crazy as it sounds, I've managed to make it work on |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hard to say without seeing all the code. There are examples such as https://svelte-maplibre.vercel.app/examples/geojson_polygon that do similar things. That one changes between having a filter and not having a filter, but if I change it to switch between two filters it continues to work. |
Beta Was this translation helpful? Give feedback.
Thanks - good to know it should work. I've managed to make it work, by setting
It did not work the first time (might have been a cache issue), but seems to work fine now.
It's a bit of black magic unfortunately for me...Also the example you've provided seems to work fine w/o requesting the static value - so I guess I need to start learning how rune, reactivity (and signal?) work under the hook...
Thanks for the feedback though.
I'll keep this post open in case I found out what's wrong on my end