-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve validation error messages relating to even/odd number of arguments #6437
Comments
Has there been any movement on this? I'm trying to replicate the gl js example here: https://docs.mapbox.com/mapbox-gl-js/example/data-join/ with my own local data: var expression = ["match", ["get", "Area"]];
However I get the following error: layers.zips-join.paint.fill-color: Expected an even number of arguments. Not sure where to even begin |
stumbled across this issue #8446, the error was unintuitive because it wasn't as obvious that the zoom is an actual input and should be treated as the first argument to the step expression... |
I assume you've moved on by now, but for the benefit of others coming across this, you may solve the issue by adding a final value of "" to your expression array, representing a default value. |
I'm removing the |
When
case
,match
,interpolate
, andstep
don't get the right number of arguments, they produce validation errors that just say "expected odd [or even] number of arguments." We should clarify these to say something more helpful. This will probably require that we don't simply do a preflight check on the number of arguments, which means we'd have a little more wasted parsing work in the case of a validation error, but I think that's worth it.The text was updated successfully, but these errors were encountered: