0

I'm getting the following error when trying to filter a SymbolLayer with match:

error image

Here's the SymbolLayer code:

<MapboxGL.SymbolLayer
  id="LayerRestaurant"
  filter={[
    'all',
    ['==', 'maki', 'restaurant'],
    ['match', 'name', 'Pita Pit', true, false],
  ]}
/>

Any ideas how can I make it work?

Thanks!

1 Answers1

0

Found a solution.

We can't mix the filters == and match with react-native-mapbox-gl.

So I just converted the == filter I was using to the match filter as well:

<MapboxGL.SymbolLayer
  id="LayerRestaurant"
  filter={[
    'all',
    ['match', ['get', 'maki'], 'restaurant', true, false],
    ['match', ['get', 'name'], 'Pita Pit', true, false],
  ]}
/>