maps icon indicating copy to clipboard operation
maps copied to clipboard

[Bug]: layer filter prop not working on iOS

Open Absor opened this issue 1 year ago • 3 comments

Mapbox Implementation

Mapbox

Mapbox Version

11.1.0

Platform

iOS

@rnmapbox/maps version

10.1.8

Standalone component to reproduce

import React from 'react';
import {
  MapView,
  ShapeSource,
  LineLayer,
  Camera,
} from '@rnmapbox/maps';

const aLine = {
  type: 'LineString',
  coordinates: [
    [-74.00597, 40.71427],
    [-74.00697, 40.71527],
  ],
};

class BugReportExample extends React.Component {
  render() {
    return (
      <MapView style={{flex: 1}}>
        <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
        <ShapeSource id="idStreetLayer" shape={aLine}>
          <LineLayer id="idStreetLayer" filter={['==', true, false]} />
        </ShapeSource>
      </MapView>
    );
  }
}

Observed behavior and steps to reproduce

When using filter prop on layer components it does nothing and all features are shown on map.

Expected behavior

Filter prop to be able to be used to filter features from layer.

Notes / preliminary analysis

RNMBXSetCommonLayerProps seems to set filter but this has no effect on the line visibility. The filtering seems to work on Mapbox v10 so this is a problem with v11 implementation.

Additional links and references

No response

Absor avatar Feb 01 '24 13:02 Absor

Try:

['==', ['literal', true], ['literal', false]]

kevinmanncito avatar Feb 05 '24 23:02 kevinmanncito

I have the same problem with the has filter on a basic cluster

IvannMG avatar Feb 06 '24 15:02 IvannMG

Try:

['==', ['literal', true], ['literal', false]]

I have tried this with multiple filters, this was just an example I threw in. Works with v10 but not with v11 so there is definitely a bug somewhere.

Absor avatar Feb 08 '24 12:02 Absor

Same issue here, Android okay.

it seems that none of the filter expressions work on ios.

artanisdesign avatar Feb 26 '24 10:02 artanisdesign

Should be fixed by: #3390

mfazekas avatar Feb 26 '24 16:02 mfazekas

Confirmed working. Thanks a lot!

Absor avatar Feb 28 '24 14:02 Absor

great stuff, thanks a lot!

artanisdesign avatar Feb 28 '24 14:02 artanisdesign