I am trying to write a filter that will match on values from several properties of a layer.

For example, in my hypothetical layer of breweries, I'd like to match those breweries that have a state name of Utah, Texas or Florida and a brewery type of Irish or American.

I can filter on state like this

var stateFilter = ['match', ['get', 'stateNam'], ['Utah','Texas','Florida'], true, false]

Or on brewery type like this

var typeFilter = ['match', ['get', 'breweryType'], ['Irish','American'], true, false]

How can I combine the two examples above into one filter? I looked at using expressions and concatenation of fields but in my actual use case, I have several fields with 100s of possible values, making the expressions cumbersome.

1 Answer 1


Looks like I had some of my expressions logic mixed up with my filter logic. Anyhow, this works

var breweryFilter=[
    ["in", "stateNam", 'Utah','Texas','Florida'],
    ["in", "breweryType", 'Irish','American']

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.