visgl / visgl/react-map-gl

[Bug] Source does not update cluster options

Open
#2,552 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

Changing the cluster property on a <Source> component does not update the cluster options of the source.

Expected Behavior

setClusterOptions() should be called on the source, instead only setData is called

https://github.com/visgl/react-map-gl/blob/c7112cf50d6985e8427d6b187d23a4d957791bb7/modules/react-maplibre/src/components/source.ts#L57

Steps to Reproduce

https://codesandbox.io/p/devbox/fancy-dew-9ks4tr

The "Cluster" button should switch between clustered and unclustered, but nothing happens. To see what should happen fork the sandbox and change the default clustered state.

Environment
  • Framework version: react-map-gl@8.0.4
  • Map library: maplibre-gl@5.7.0
Logs

No response

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

Read modules/react-maplibre/src/components/source.ts around line 57 and compare the handling of setData with the cluster prop. Use the linked CodeSandbox to reproduce the issue by toggling the Cluster button. Done means changing cluster causes setClusterOptions() to update the source between clustered and unclustered behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.