visgl / visgl/react-map-gl

[Bug] getCenter() seems broken in Chrome on MacOs since 8.0 update

Open
#2,546 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

Previously we were using 7.1.x and map.getCenter() was working fine, but since we moved to 8.0.4 we have at least one person for whom getCenter() always returns the initial map position center, not the updated position after panning, etc...

Not 100% sure it's a Mac issue but the exact same code/branch still works fine on Ubuntu and they're both on Chrome so not sure what else could be the cause.

Expected Behavior

No response

Steps to Reproduce
  • Open map app on Chrome on MacOs
  • call map.getCenter()
  • pan camera somewhere else
  • call map.getCenter() again
  • same value is returned for getCenter both times
Environment
  • Framework version: react-map-gl@8.0.4
  • Map library: I'm not sure, I did not set up this project, all I see is @mapbox/mapbox-gl-draw@1.5
  • Browser: Chrome 136
  • OS: MacOS (newer, not sure exact version)
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 by reproducing the reported getCenter() sequence with react-map-gl@8.0.4 in Chrome on macOS: read the center, pan the map, and read it again. Compare the result with Ubuntu and the previously working 7.1.x setup; done means getCenter() returns the updated position after panning or the issue is narrowed to a documented environment or integration cause.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.