SymbolLayer filter property data type error; unable to pass filter array
See original GitHub issueDescribe 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
<Mapbox.ShapeSource>
<Mapbox.SymbolLayer
id="guz"
style={{ visibility: "visible" }}
filter={[
'all',
['==', '$type', 'Point'],
['in', 'type', 'Blue Project', 'WFW Project']
]}
/>
</Mapbox.ShapeSource>
Expected behavior The symbol layer should filter by the array passed into the SymbolLayer object.
Screenshots
Versions (please complete the following information):
- Platfrom: iOS
- Device: XR Simulator
- React Native Version 0.59
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:
<MapboxGL.CircleLayer
id="clusteredPoints"
belowLayerID="pointCount"
filter={['has', 'point_count']}
style={layerStyles.clusteredPoints}
/>
Not sure why the SymbolLayer array I’m passing in is having the issue.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
SymbolLayer filter property data type error; unable to pass ...
When I pass an array to the filter property an exception is thrown saying "filter property must be a string". ... The symbol...
Read more >MapboxGL.SymbolLayer filter expression to check if id in array
state.nextPossible and if the property type matches 'alt'. I am clearly doing something wrong, the error I am getting says: Invalide predicate ......
Read more >Expressions | Style Specification | Mapbox GL JS
Data expressions are allowed as the value of the filter property, ... If this check fails, it produces an error and causes the...
Read more >How do I filter data in Flow? - Power Platform Community
Add a "Filter array" action, From set to output of "Get rows" action, within Condition box, click "Edit in advanced mode", type the...
Read more >5. Filtering Data - ParaView Documentation
Similar to readers, the properties on the filter allow you to control the ... sphere, or a box) or using values of a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It turns out
in
and'==',$type
is legacy filter syntax, and it’s no longer supported. Use the new expression syntax to get it work:"!has"
is legacy filter syntax too use["!", ["has" ...]
@lpfunding it seems that ios mapbox-gl-native have trouble with
!has
too - to be reported on upstream repo.instead of
you can try: