I’ve got a layer that starts with no filter and a set of radio buttons that are generated from the layer data using queryRenderedFeatures
to get the unit_type
CSV for each point, it then separates out the values, ignores duplicates and creates the radio buttons based on the array it has created.
When clicking one of the radio buttons it creates the following filter: ['in', 'unit_type', sector]
where sector
is the value of the radio button.
The expected behaviour is to show all points that have the value of the radio button in their unit_type
value even if it’s a substring, as the Mapbox Documentation shows this is it’s primary use case.
What actually happens, is that it renders the points with only an exact match to the value.
I have also tried has but that requires an object and does not allow for substrings as far as I can tell.
What am I doing wrong with the expression that is making this not function as expected?