GPUGridLayer
Quick answer
GPUGridLayer was deck.gl's GPU-side grid aggregation layer: it binned points into a screen-aligned grid and computed cell weights on the GPU. It was deprecated in the v8 line and is no longer exported by deck.gl v9, so new code should use GridLayer or a custom GPU aggregation layer instead.
new deck.GPUGridLayer ( props )
Key points
- Aggregated points into grid cells without transferring raw data back to the CPU.
- Accepted cellSize, getPosition and getWeight plus GPU aggregation props.
- Migrate to GridLayer for CPU aggregation or a custom layer for GPU compute.
Example
var grid = new deck.GPUGridLayer({
id: 'grid-density',
data: taxiPoints,
getPosition: function (d) { return [d.lng, d.lat]; },
cellSize: 400,
colorAggregation: 'COUNT',
getColorWeight: 1,
colorRange: [
[255, 255, 204, 160],
[199, 233, 180, 170],
[127, 205, 187, 180],
[65, 182, 196, 190],
[44, 127, 184, 200],
[37, 52, 148, 210]
],
colorDomain: [0, 3000],
elevationAggregation: 'COUNT',
elevationScale: 12,
extruded: true,
upperPercentile: 98,
pickable: true
});var next = grid.clone({
cellSize: 200,
elevationScale: 6
});
deckgl.setProps({ layers: [next] });
Notes
- Importing GPUGridLayer from @deck.gl/aggregation-layers fails in deck.gl v9 because the class was removed.
- The old GPU aggregation props do not map one-to-one onto GridLayer; rewrite the layer configuration.
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Atlaslog (2026). GPUGridLayer. https://www.jingweizhi.com/en/deckgl/api/gpu-grid-layer.html (accessed 2026-11-03).