-
-
Notifications
You must be signed in to change notification settings - Fork 818
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
SymbolLayer filter property data type error; unable to pass filter array #70
Comments
@systemlevel seems to be an upstream mapbox-native-gl / ios issue. The expression is converted to NSPredicate then back to mapbox expression. [
'all',
['==', '$type', 'Point'],
['in', 'type', 'Blue Project', 'WFW Project']
] Becomes "$type" == "Point" AND MGL_FUNCTION("in", "type", "Blue Project", "WFW Project") == 1 Which becomes [
'all',
['==', '$type', 'Point'],
['==', ['in', 'type', 'Blue Project', 'WFW Project'], 1],
] And then it fails to parse this expression. |
Bug was reported to upstream repo: mapbox/mapbox-gl-native#14805 |
@mfazekas thanks so much for reporting that upstream. |
Would this issue hinder the EarthQuakes.js example from working? I tried to build it in the exact same way, but the app crashes everytime I launch... Any idea how long this bug will take to fix? I believe this issue also exists in SymbolLayer! |
@lpfunding it seems that ios mapbox-gl-native have trouble with instead of filter={['!has', 'point_count']} you can try: filter={['!', ['has', 'point_count']]} |
The |
It turns out ["all",
["==",["geometry-type"], "Point"],
["match",
["get", "type"],
["Blue Project", "WFW Project"], true,
false]
]
|
Describe the bug
SymbolLayer filter property docs specify passing a type array. When I pass an array to the filter property an exception is thrown saying "filter property must be a string".
To Reproduce
Expected behavior
The symbol layer should filter by the array passed into the SymbolLayer object.
Screenshots
Versions (please complete the following information):
Additional context
Add any other context about the problem here.
In the project examples an array appears to be successfully used. For example, in the EarthQuakes.js example the CircleLayer appears to use an array filter:
Not sure why the SymbolLayer array I'm passing in is having the issue.
The text was updated successfully, but these errors were encountered: