Skip to main content


The GridCellLayer can render a grid-based heatmap. It is a variation of the ColumnLayer. It takes the constant width / height of all cells and bottom-left coordinate of each cell. This is the primitive layer rendered by CPUGridLayer after aggregation. Unlike the CPUGridLayer, it renders one column for each data object.

import {Deck} from '';
import {GridCellLayer} from '';

const layer = new GridCellLayer({
id: 'GridCellLayer',
data: '',

cellSize: 200,
extruded: true,
elevationScale: 5000,
getElevation: d => d.value,
getFillColor: d => [48, 128, d.value * 255, 255],
getPosition: d => d.centroid,
pickable: true

new Deck({
initialViewState: {
longitude: -122.4,
latitude: 37.74,
zoom: 11
controller: true,
getTooltip: ({object}) => object && `height: ${object.value * 5000}m`,
layers: [layer]


To install the dependencies from NPM:

npm install
# or
npm install
import {GridCellLayer} from '';
import type {GridCellLayerProps} from '';

new GridCellLayer<DataT>(...props: GridCellLayerProps<DataT>[]);

To use pre-bundled scripts:

<script src="^9.0.0/dist.min.js"></script>
<!-- or -->
<script src="^9.0.0/dist.min.js"></script>
<script src="^9.0.0/dist.min.js"></script>
new deck.GridCellLayer({});


Inherits from all Base Layer properties.

Render Options

cellSize (number, optional) transition-enabled

  • Default: 1000

Size of each grid cell in meters

coverage (number, optional) transition-enabled

  • Default: 1

Cell size scale factor. The size of cell is calculated by cellSize * coverage.

elevationScale (number, optional) transition-enabled

  • Default: 1

Elevation multiplier. The elevation of cell is calculated by elevationScale * getElevation(d). elevationScale is a handy property to scale all cell elevations without updating the data.

extruded (boolean, optional)

  • Default: true

Whether to enable grid elevation. If set to false, all grid will be flat.

material (Material, optional)

  • Default: true

This is an object that contains material props for lighting effect applied on extruded polygons. Check the lighting guide for configurable settings.

Data Accessors

getPosition (Accessor<Position>, optional) transition-enabled

  • Default: x => x.position

Method called to retrieve the bottom-left corner ([minX, minY]) of each cell.

getColor (Accessor<Color>, optional) transition-enabled

  • Default: [255, 0, 255, 255]

The rgba color of each object, in r, g, b, [a]. Each component is in the 0-255 range.

  • If an array is provided, it is used as the color for all objects.
  • If a function is provided, it is called on each object to retrieve its color.

getElevation (Accessor<number>, optional) transition-enabled

  • Default: 1000

The elevation of each cell in meters.

  • If a number is provided, it is used as the elevation for all objects.
  • If a function is provided, it is called on each object to retrieve its elevation.