visgl / visgl/react-map-gl

[Bug] `onMouseMove` ignores `interactiveLayerIds`

Open
#1,950 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

The way I read the docs for onMouseMove (https://visgl.github.io/react-map-gl/docs/api-reference/map#onmousemove) when I specify a layer in interactiveLayerIds, the events should only fire while I move the mouse over one of the elements of those specified layers.

That is how it works for onMouseEnter (console log a) and onMouseLeave (console log b) on the blue line.

However, for onMouseMove the events fire all the time.

image
Expected Behavior

I expected onMouseMove to behave the same way as onMouseEnter/Leave, to only fire when hovering the blue lines (which are the layer I specified with interactiveLayerIds).

Steps to Reproduce

(On request)

Environment
  • Framework version: "react-map-gl": "^7.0.17",
  • Map library: "maplibre-gl": "^2.1.9",
  • Browser: Chrome
  • OS: macOS
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

Start with the onMouseMove API and its interactiveLayerIds behavior described in the issue and documentation link. Reproduce the reported setup with react-map-gl 7.0.17 and maplibre-gl 2.1.9, then compare onMouseMove with onMouseEnter/onMouseLeave; done means movement events fire only while hovering the specified blue layer.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.