Atlaslog
Atlaslog / Field Notes / deck.gl visualization
Field note · deck.gl visualization

Clicks always return info.object null

Quick answer

The click handler fires but receives color null, index -1 and object null, because the layer was never marked pickable or a full-screen layer above it wins the pick. Picking is a separate render pass that only opted-in layers join.

Last verified 2026-11-03 · Multiple versions · Cite this page
Applies to: deck.gl
Symptom
Checklist
  1. Call deck.pickObject at the click coordinates to separate a layer problem from an event-wiring problem.
  2. Print pickable, visible and coordinateSystem for every layer via deck.layerManager.getLayers().
  3. Look for a background PolygonLayer covering the viewport that is still pickable.
  4. Check pickingRadius and whether the deck canvas sits beneath the MapLibre canvas.
Fix

Set pickable: true on the data layer, pickable: false on decorative full-screen layers, keep pickingRadius at 5, and pass complete business objects in data so info.object is populated.

Code
{ color: null, index: -1, picked: false, x: 412, y: 337, object: null, layer: null }
var info = deck.pickObject({ x: 412, y: 337, radius: 4 });
console.log(info && info.layer ? info.layer.id : 'no layer', info && info.object);
Watch out
All 120 field notesChinese originalRunnable examples
English edition written for Atlaslog from the original Chinese field note. Code is unchanged and runs as-is.
Cite this page

Atlaslog (2026). Clicks always return info.object null. https://www.jingweizhi.com/en/cookbook/deckgl-pick-fail.html (accessed 2026-11-03).