-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat(core): 3D enable MapController using new rotatePivot option #9938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
felixpalmer
wants to merge
19
commits into
master
Choose a base branch
from
felix/rotate-pivot-3d
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
felixpalmer
commented
Jan 15, 2026
|
|
||
| import {Deck} from '@deck.gl/core'; | ||
| import {Tile3DLayer} from '@deck.gl/geo-layers'; | ||
| import {ScenegraphLayer} from '@deck.gl/mesh-layers'; |
Collaborator
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test app for demo only, will not be commiting
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
Building on top of the 3D picking infrastructure in #9937
MapControllerzooms to the position of the cursor, but when a rotation/tilt is triggered using the Shift Key, the center is always fixed at the center of the viewport, with z=0.For flat scenes this works OK, but when we are using a layer that has some non-zero elevation, for example
TerrainLayerorTile3DLayerthe movement feels unnatural.This PR adds a new prop to the
MapController:rotationPivot: 'center' | '2d' | '3d'which means the rotate/tilt operation is anchored on:'center': Center of viewport, with z=0 irrespective of mouse position (current behavior)'2d': Mouse position, with z=0'3d': Mouse position, with z raycast onto sceneThe following videos demonstrate the behavior:
Mouse grabbed in bottom left corner, but pivot is in center of screen:
Screen.Recording.2026-01-15.at.16.01.09.mov
Pivot is now correctly at mouse location, but behind building as z=0 is assumed
Screen.Recording.2026-01-15.at.16.01.29.mov
Pivot is now on front side of the building
Screen.Recording.2026-01-15.at.16.01.48.mov
Works even with multiple layers, why not pivot on planes in the sky!
Screen.Recording.2026-01-15.at.16.02.16.mov
Change List
rotationPivotpropMapController_pickPositionForControllertoDeckto provide way forMapControllerto access pickingrotationPivotPositioninInteractionStateto enable drawing helper layer showing pivot locationLimitations