mapbox / mapbox/mapbox-gl-js

Support feature-state in layer filters

Open
#8,487 4 comments 25 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cross-platform :tv: feature :green_apple:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

## Motivation

We use `feature-state` for client side data joins. We would like to do some dynamic filtering of the data based on feature-state.

## Design Alternatives

We could as a work around set the opacity of these features to 0 conditionally. It does seem a bit hacky though.

## Design

I'm not sure about the technicalities, but it seems that feature-state could just be allowed in filter expressions.

### Concepts

I don't think there are any new concepts here, just broadening existing features to work together.

### Implementation

No idea.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing filter-expression handling and feature-state support in mapbox-gl-js, since the issue names no files or tests. Define how feature-state should participate in layer filters, then add coverage showing dynamic filtering works and preserves current filter behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.