Skip to content

mapbox-overlay: synchronize camera before onLoad callback - #10735

Merged
chrisgervang merged 5 commits into
visgl:masterfrom
kahole:fix/mapbox-initial-camera-sync
Oct 11, 2026
Merged

chrisgervang merged 5 commits into
visgl:masterfrom
kahole:fix/mapbox-initial-camera-sync

Conversation

@kahole

@kahole kahole commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Mirror of deck.gl/maplibre fix #10702 for deck.gl/mapbox


Note

Low Risk
Startup ordering fix for interleaved Mapbox overlay view state; scoped to Deck init path with a regression test.

Overview
Fixes interleaved MapboxOverlay startup so Deck’s view state matches the map when onLoad runs.

For a not-yet-initialized Deck, the custom onLoad now calls onMapMove after watchMapMove and before the user’s onLoad, so camera updates between adding the control and Deck init are applied once. User onLoad still runs after that sync (same pattern as the maplibre fix).

Adds a WebGL test that moves the map before load and asserts view state at onLoad, including a zoom change triggered inside onLoad.

Reviewed by Cursor Bugbot for commit 7c1368f. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with the startup ordering fix covered by a focused regression test.

Summary

Synchronizes the interleaved MapboxOverlay camera with the current map state before invoking the user’s onLoad callback.

  • Starts map-move observation before the initial camera synchronization.
  • Adds a WebGL regression test covering pre-load and in-callback camera changes.
  • Guarantees test cleanup with a try/finally block.

Reviews (5) · Last reviewed commit: "Merge branch 'master' into fix/mapbox-in..." · Reviewed by Greptile

@coveralls

coveralls commented Sep 30, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 83.52% (+0.03%) from 83.493% — kahole:fix/mapbox-initial-camera-sync into visgl:master

@chrisgervang
chrisgervang merged commit f0686c2 into visgl:master Oct 11, 2026
8 checks passed
@chrisgervang chrisgervang added this to the v9.4 patch releases milestone Oct 11, 2026
@chrisgervang chrisgervang mentioned this pull request Oct 22, 2026
53 of 66 tasks
chrisgervang added a commit that referenced this pull request Oct 22, 2026
* mapbox-overlay: synchronize camera before onLoad callback

* test(mapbox): clean up overlay in finally

---------

Co-authored-by: Chris Gervang <[email protected]>
Co-authored-by: Chris Gervang <[email protected]>
(cherry picked from commit f0686c2)
@chrisgervang

Copy link
Copy Markdown
Collaborator

Released in deck.gl 9.4.1. Thanks @kahole!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants