You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on that error message, the filter doesn't recognize that ['get', '$haystack'] is a sub-expression and is interpreting it as an array. If ['in', 'needle', ['get', '$haystack']] works fine on its own then I assume the error might be due to combining the two syntax types. If you can update the ticket with an example, that will help figure out the issue. For what it's worth though, the older syntax is considered deprecated and we'd recommend using only the expression syntax if possible.
@jliebrand Actually, our docs warn that you cannot combine the old and new syntax in a single filter statement. See https://docs.mapbox.com/mapbox-gl-js/style-spec/other/#other-filter. I'm going to close this in light of that. If you feel that something else is going on, let us know and provide a minimal example. Thanks!
I'm still trying to put this in a jsbin, but thought I'd get this down here first.
If I use the in expression to find a substring from a string, things work fine:
And if I use the in expression in the older(?) syntax, that works fine also:
But combining the two causes an error:
Error: layers[51].filter[2][2]: string, number, or boolean expected, array found
at Object.bn [as emitValidationErrors]
Am I doing something wrong, or is it not happy about the two formats of "in" ?
The text was updated successfully, but these errors were encountered: