[Bug] ScatterplotLayer hover/click not working properly when circles overlap
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 14.6k
- Forks
- 2.3k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 42
Description
Description
I'm using ScatterplotLayer and the circles that are drawn first (bottom ones) are hovered instead of the ones at the top when there's an overlap.
Same with onClick.
Although it works fine when the map is pitched and billboard is set to true.
Also works when interleaved:false
const overlay = useControl<IControl>(() => {
return new MapboxOverlay({
layers: [
new ScatterplotLayer({
data: [...],
visible: true,
pickable: true,
stroked: true,
autoHighlight: true,
billboard: true,
highlightColor: [...],
radiusUnits: "meters",
getRadius: 70,
getLineColor: ...,
getLineWidth: ...,
beforeId: "country-label-lg"
})
],
interleaved: true,
}) as IControl;
});
Is this a known issue or am I doing something wrong here ?
Flavors
- React
- Python/Jupyter notebook
- MapboxLayer
- GoogleMapsOverlay
- CartoLayer
- DeckLayer/DeckRenderer for ArcGIS
Expected Behavior
- Circles that are on top should be picked (hovered/clicked)
Steps to Reproduce
/
Environment
- Framework version: 8.8.20
- Browser: Chromium 108.0.5359.125; Safari 16.1
- OS: macOS Ventura 13.0.1
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 reproducing the overlap case with ScatterplotLayer through MapboxOverlay using interleaved: true, then compare picking behavior with interleaved: false and with billboard enabled. Trace the ScatterplotLayer hover and onClick picking path; done means the top circle is consistently picked for both interactions in the affected configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data-visualization, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100