Repository navigation
Conversation
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 146d53c. Configure here.
| this.longitude = longitude; | ||
| this.bearing = bearing; | ||
| this.pitch = pitch; | ||
| this.roll = roll; |
There was a problem hiding this comment.
Globe bounds ignore camera roll
Medium Severity
GlobeViewport.getBounds still samples screen mid-edges and wraps only left/right as west/east. After roll, those edges are no longer the geographic extrema, so the returned box can omit visible corners and mis-handle the antimeridian. Tile loading, culling, and callers of getBounds on a rolled globe can drop content.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 146d53c. Configure here.
There was a problem hiding this comment.
Seems worth looking into
chrisgervang
left a comment
There was a problem hiding this comment.
This is awesome! Most comments are style, doc, or test suggestions
| Roll is applied around the camera's forward axis after pitch and bearing, including | ||
| the Mercator projection used at high zoom. The controller preserves it during | ||
| interaction but does not provide a roll gesture. | ||
|
|
There was a problem hiding this comment.
| Roll is applied around the camera's forward axis after pitch and bearing, including | |
| the Mercator projection used at high zoom. The controller preserves it during | |
| interaction but does not provide a roll gesture. |
I don't think this is necessary. How does maplibre offer a roll gesture, if at all? Maybe we can offer it too on deck controllers
There was a problem hiding this comment.
MapLibre supports Ctrl + right-click dragging when rollEnabled: true is set (disabled by default). See its rollEnabled option and mouse roll handler. Adding the equivalent deck controller gesture would be a separate interaction change; this PR supplies the camera state and preserves roll through existing interactions.
| // The camera may have moved while Deck was initializing. | ||
| onMapLibreMove(deck, map); |
There was a problem hiding this comment.
This seems like a potentially unrelated bug fix, or an unnecessary call. Can you check? If needed, let's split out into its own PR and understand when this happens in practice
There was a problem hiding this comment.
Confirmed this is an independent bug. Calling map.jumpTo(...) immediately after adding an interleaved overlay leaves Deck's initial camera state stale. Split the fix and a dedicated regression test into #10702. The test fails on master for MapLibre 4.5.1, 5.0.0, and 6.0.0, and passes with the fix. The roll test now waits for initialization before changing roll.
| // Deck.finalize removes its canvas but does not release the WebGL context. | ||
| // Avoid exhausting the browser context limit in the shared test page. | ||
| overlayCanvas?.getContext('webgl2')?.getExtension('WEBGL_lose_context')?.loseContext(); |
There was a problem hiding this comment.
@Pessimistress @felixpalmer @ibgreen it seems odd that the context isn't released after finalize. Do you have any idea if that is intentional, a bug, or if this is just an over-cautious LLM addition?
There was a problem hiding this comment.
Hey @birkskyum, this context finalization behavior sounds concerning, if true.
I'd rather see the issue addressed in the module than merge in a testing hack
Co-authored-by: Chris Gervang <[email protected]>
Co-authored-by: Chris Gervang <[email protected]>
Co-authored-by: Chris Gervang <[email protected]>
Co-authored-by: Chris Gervang <[email protected]>
Co-authored-by: Chris Gervang <[email protected]>
Co-authored-by: Chris Gervang <[email protected]>
Co-authored-by: Chris Gervang <[email protected]>
Co-authored-by: Chris Gervang <[email protected]>
Co-authored-by: Chris Gervang <[email protected]>
Comments Outside DiffThese findings sit on lines the diff does not cover, so they could not be posted inline. Each one leaves this list once its file changes.
|
Is there an issue or PR for more information about this? |
@chrisgervang it was the issue here visgl/luma.gl#3177 , which got fixed in visgl/luma.gl#3178 |
|
Oh great, let's add interleaved coverage then |


@chrisgervang Here's the addition of roll to deck.gl - relevant for e.g. noodles.gl
For #10503
Background
Calling
map.setRoll()currently banks MapLibre's basemap while deck.gl layers remain level. This adds camera roll to geospatial view states and synchronizes it through the new@deck.gl/maplibrepackage, so projected coordinates, rendered layers, and picking follow the same camera.Change List
roll(degrees, default0) toMapViewState,GlobeViewState, and their viewports. Positive roll rotates the image counter-clockwise, matching MapLibre.getRoll()in@deck.gl/maplibre, with a zero fallback for v4.5.1. Cover v5/v6, Mercator/globe, and overlaid/interleaved modes.Draft notes
The independent startup camera synchronization fix and focused v4/v5/v6 regression tests have been split into fix(maplibre): sync camera changes made during Deck initialization #10702.
No new roll gesture is introduced. Roll is controlled through view state, transitions, or MapLibre's camera API.
Interleaved resize coverage is held back by an existing framebuffer-size issue: after changing the map container size, the CPU viewport updates but rendering uses stale framebuffer dimensions. Reproduced with zero roll against the unchanged base commit
3aabc11038. Overlaid resize is covered.Terrain-specific integration and the golden-image/website suites have not been validated in this draft.
Note
Medium Risk
Touches core camera matrices, bounds, and MapLibre view-state sync, but behavior is guarded by broad new tests and defaults preserve prior zero-roll rendering.
Overview
Adds optional
roll(degrees, default0) to Mercator and globe view states so deck.gl layers bank with the same camera as MapLibre whensetRoll()is used.Roll is applied in the viewport view matrix after bearing and pitch, with Mercator-specific fixes for far-plane clipping, geographic bounds, and repeated worlds. Map and Globe controllers keep roll through pan/zoom/rotate, normalize angles, and globe panning maps screen drag through the rolled axes. Linear and fly-to transitions interpolate roll (shortest path) and treat missing
rollas0so existing view states do not spuriously animate.@deck.gl/maplibrereadsmap.getRoll()(falls back to0on older MapLibre). Docs and regression tests cover projection, picking, controllers, transitions, and v5/v6 Mercator/globe overlay alignment.Reviewed by Cursor Bugbot for commit 3e1969f. Bugbot is set up for automated code reviews on this repo. Configure here.