You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a mapbox app that plots points on a map and lets the user hover to reveal additional info. To detect hover state, I'm using a mousemove event + queryRenderedFeatures, but the event's lngLat doesn't always correspond to the mouse cursor's apparent position. It appears to happen at intermediate zoom levels (approximately zoom "5.5"). Setting the map projection to "mercator" prevents the offset from occurring, but I prefer to keep the default "globe" view if possible.
Is there any way to fix the offset, while still using "globe" projection?
mapbox-gl-js version: 3.7.0
browser: Chrome, Safari, Edge
Steps to Trigger Behavior
Create a map with the default "globe" projection, set to zoom level 5.5
Trigger a mousemove event and get the lngLat
Draw a point at the lngLat coordinates, and notice that it is not aligned with the mouse
Link to Demonstration
I built this debug app to show the offset visually. Mousing over the red dots in the grid should cause a popup to appear. The green-and-red circle shows the mousemove event's point.lngLat coordinates. The green-and-red circle does not track my cursor precisely, which makes it hard to select a specific dot. https://output.jsbin.com/xewegam/1
Expected Behavior
mousemove lngLat is visually aligned with the mouse cursor
Actual Behavior
lngLat is misaligned, with a variable offset that depends on the position of the cursor within the map window
The text was updated successfully, but these errors were encountered:
I have a mapbox app that plots points on a map and lets the user hover to reveal additional info. To detect hover state, I'm using a mousemove event + queryRenderedFeatures, but the event's lngLat doesn't always correspond to the mouse cursor's apparent position. It appears to happen at intermediate zoom levels (approximately zoom "5.5"). Setting the map projection to "mercator" prevents the offset from occurring, but I prefer to keep the default "globe" view if possible.
Is there any way to fix the offset, while still using "globe" projection?
mapbox-gl-js version: 3.7.0
browser: Chrome, Safari, Edge
Steps to Trigger Behavior
Link to Demonstration
I built this debug app to show the offset visually. Mousing over the red dots in the grid should cause a popup to appear. The green-and-red circle shows the mousemove event's point.lngLat coordinates. The green-and-red circle does not track my cursor precisely, which makes it hard to select a specific dot.
https://output.jsbin.com/xewegam/1
Expected Behavior
mousemove lngLat is visually aligned with the mouse cursor
Actual Behavior
lngLat is misaligned, with a variable offset that depends on the position of the cursor within the map window
The text was updated successfully, but these errors were encountered: