mapbox / mapbox/mapbox-gl-js

Using transform:scale in css causes mapbox mouse events to be offset

Open
#13,169 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**mapbox-gl-js version**: ^3.3.0

### Question
![Snipaste_2024-05-06_17-04-58](https://github.com/mapbox/mapbox-gl-js/assets/9527142/4de4b506-d123-48c9-b9e8-070e591c75c5)
![Snipaste_2024-05-07_22-22-46](https://github.com/mapbox/mapbox-gl-js/assets/9527142/d142afe7-655b-4138-85ec-37846024a2bd)

### The result returned by the getScaledPoint function does not take into account transform:scale

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 by locating the getScaledPoint entry point and the mouse-event coordinate handling in mapbox-gl-js. Reproduce the issue with transform:scale and verify that returned points and mouse events align with the visually scaled map; add or update coverage if the relevant test location is found.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.