dimfeld / svelte-maplibre

Svelte bindings for the MapLibre mapping library
https://svelte-maplibre.vercel.app
MIT License
283 stars 34 forks source link

Filter not working unless I run a function #124

Closed Hedronmx closed 4 months ago

Hedronmx commented 4 months ago
image

So this is the code.

Basically select is an array of state names like this ["Alabama", "California"] that gets populated based on a select.

The issue is, I want to show the states selected on the map but it wont update the filter unless i click a button that runs the function clearSelect.

Am I doing something wrong with the expression??

dimfeld commented 4 months ago

can you show a full example, ideally one that I can run?

Hedronmx commented 4 months ago
image

This is the html.

THis is a video i recorded showing whats going on. I cant really show you the whole project, because its got some sensitive data from work.

https://github.com/dimfeld/svelte-maplibre/assets/26935602/f476f723-60b6-4647-aa1a-a01f3cc29d26

As you can see the filter only works after i run the clearSelect function which makes the select variable into an empty array

dimfeld commented 4 months ago

Hmm, that does seem odd. Nothing looks obviously wrong. If you are able to come up with a reproduction that I can get my hands on and debug, I'm happy to take a closer look.

Hedronmx commented 4 months ago

For some weird reason it got fixed on its own.... Ill close this! thanks btw