visgl / visgl/react-map-gl

[Feat] Support New Mapbox GL JS Interactions API (v3.9.0+)

Open
#2,551 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
TypeScript
Stars
8.5k
Forks
1.4k
Avg merge
5d 17h
Merged PRs (30d)
3

Description

Target Use Case

Mapbox GL JS v3.9+ adds a new Interactions API (map.addInteraction() / map.removeInteraction()) for handling events declaratively on layers, featuresets, or the whole map.

This would remove the map.on/off boilerplate and make interactions reactive with props/state.

Proposal

It’d be great if react-map-gl exposed a simple component/hook for this, e.g.:

<Interaction
  type="click"
  target={{ layerId: 'my-layer' }}
  onEvent={(e) => console.log(e.feature)}
/>

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 reading the Mapbox GL JS v3.9+ Interactions API documentation linked in the issue, then inspect how react-map-gl currently exposes map.on/off event handling. Define the component or hook API around declarative targets and event callbacks. Done means the new interaction behavior is exposed without the proposed map.on/off boilerplate and supports the stated layer, featureset, or map targets.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.