Skip to content

feat(core): Add pickable: '3d' option to all Layers#9937

Merged
felixpalmer merged 11 commits intomasterfrom
felix/3d-picking
Jan 30, 2026
Merged

feat(core): Add pickable: '3d' option to all Layers#9937
felixpalmer merged 11 commits intomasterfrom
felix/3d-picking

Conversation

@felixpalmer
Copy link
Collaborator

@felixpalmer felixpalmer commented Jan 15, 2026

Background

Currently the GPU picking infrastructure only returns the xy (often latitude, longitude) of the picked point in callbacks like onClick & onHover. For many scenes, but in particular 3D tiles, having the ability to obtain the z component is useful.

This PR adds a new option for the pickable prop, '3d'. When enabled on a Layer the picking engine will perform a depth picking operation and then unproject the view to obtain the full 3D position. The altitude is available simply as info.coordinate[2] and so can easily be integrated into the usual tooltips

Screen.Recording.2026-01-15.at.15.47.29.mov
Screen.Recording.2026-01-15.at.15.48.43.mov

Note: videos made with this luma patch included

Change List

  • Extend Deck class to specially handle layers with pickable: '3d'
  • Extend types
  • Example app (will be removed from PR before merge)


import {Deck} from '@deck.gl/core';
import {GeoJsonLayer, ArcLayer} from '@deck.gl/layers';
import {Tile3DLayer} from '@deck.gl/geo-layers';
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use this just to test, I don't intend to merge the changes

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been wondering if we can somehow support PR-specific demos. Essentially, a Github action that builds deck and deploys a static bundle of a relevant example and deck itself to something like Cloudflare.

Then PR authors can make a one-offs like this that aren't merged in, and/or can test with an existing example

Would you use something like a codepen/Codesandbox that consumes a deck bundle for this PR? Or find it useful to have the layer browser deployed in a PR when a layer module is updated?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certainly I think there is value in providing an easy way for reviewers to test, but it also needs to not introduce friction for the author of the PR. Modifying an example like this is nice because the reviewer just needs to pull the branch and run the test.

Things that would improve the flow for me would be:

  • An auto-build & deploy feature so reviewers (who may not always be technical) can easily run the example.
  • A rule to prevent such changes being merged

Perhaps we could have a template in the deck.gl repo, e.g. examples/code-review which when modified and push as part of a PR is;

  • built and deployed, with a link added to the PR
  • Ignored (changes dropped) when the PR is merged

@coveralls
Copy link

coveralls commented Jan 27, 2026

Coverage Status

coverage: 91.089% (-0.01%) from 91.101%
when pulling a2d86bf on felix/3d-picking
into 9d4542b on master.

@felixpalmer
Copy link
Collaborator Author

@juice928 stop

For posterity, I did review both these suggestions and they are both nonsense, lacking an understanding of the codebase:

  • this.layerManager cannot be null, there is an early exit just a few lines above. Why even comment on such issues, we have Typescript
  • There is no point passing layers or viewports to this._pick() as the method retrieves these objects by itself

Both these suggestions are symptomatic of bad LLM "code review" - they only look at the narrow surroundings of a line of code and think they can be "helpful" by inventing low-hanging fruit issues and offering plausible sounding fixes

@felixpalmer felixpalmer merged commit 72943bf into master Jan 30, 2026
3 checks passed
@felixpalmer felixpalmer deleted the felix/3d-picking branch January 30, 2026 10:34
@chrisgervang
Copy link
Collaborator

Oof, yeah that's not useful. Who ever added cursor bugbot on the other hand.. thank you, that one catches real issues and cleans itself up with fixes are pushed

@chrisgervang chrisgervang added this to the v9.3 milestone Feb 2, 2026
@chrisgervang chrisgervang mentioned this pull request Feb 3, 2026
12 tasks
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