[Feat] Support New Mapbox GL JS Interactions API (v3.9.0+)
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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