Closed mattijsf closed 1 year ago
As a temporary workaround we use ["==", ["get", "data_property"], 0]
. But like I said, in some cases Mapbox Studio's expression builder is constructing a match
expression for simple numeric equality checks which cannot be parsed by Expression.fromRaw
Thanks for the report @mattijsf , the root cause is identified and we will provide a fix in the coming releases.
Environment
Observed behavior and steps to reproduce
Parsing a match expressing using fromRaw containing numeric label will causing a ClassCastException
Expression:
["match",["get","data_property"],[0],true,false]
Example:
com.mapbox.maps.extension.style.expressions.generated.Expression.fromRaw("[\"match\",[\"get\",\"data_property\"],[0],true,false]")
Exception:
I'm aware that this expression can be written more optimal using an equal expression but this expression was generated by Mapbox Studio somehow and was causing a crash in our app when processing / parsing a mapbox studio generated style.
Also, changing the
[0]
into["0"]
succeeds but that doesn't change the fact that the Expression parser should be able to parse the above expression.Expected behavior
Expression gets parsed normally with the numeric array