Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hover events should react to map movement #6830

Open
mourner opened this issue Jun 18, 2018 · 1 comment
Open

Hover events should react to map movement #6830

mourner opened this issue Jun 18, 2018 · 1 comment
Labels

Comments

@mourner
Copy link
Member

mourner commented Jun 18, 2018

mapbox-gl-js version: v0.46.0-beta.1

Steps to Trigger Behavior

  1. Set up a mouseenter/mouseleave listener on a layer.
  2. Move the map by any means other than dragging (e.g. pan using keyboard, or programmatically zoom in on click).

Link to Demonstration

https://www.mapbox.com/mapbox-gl-js/example/hover-styles/
Click on the map to focus on it, then hover on a state and press a keyboard arrow to pan away. The hovered status doesn't change.

Expected Behavior

The mouse events should trigger when the map moves under the cursor just like they do when the cursor moves over the map.

Actual Behavior

The mouse events don't trigger on map movement.

Discovered this while setting up a "Click on cluster to zoom in and expand it" demo. It's pretty common to have "click on a feature to zoom in / center on it" interaction, but if you have hover states at the same time, they become glitchy.

hover-bug

cc @jfirebaugh

@andrewharvey
Copy link
Collaborator

Happens with fitBounds and flyTo as well. You can see this on the hover demo by doing a boxzoom and not moving the cursor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants