deckgl ยท console.warn
bindDeck: options.layers is not a function; ...
Printed by deckgl, prefixed [lattice], since 1.74.0.
Warnings reference › deckgl:layers
- Identifier
deckgl:layers- Raised by
- deckgl
- Since
- 1.74.0
What happened
The module imports nothing of deck.gl's, so it cannot build a layer itself: the page supplies a function that turns the grid's rows into deck.gl layers with its own classes. options.layers was not a function (an array of layers, say), so there is nothing to call when the rows change. Nothing was bound.
The fix
Pass a function of the rows and a context that returns the layers.
The smallest fix
layers: (rows, ctx) => [new deck.ScatterplotLayer({ id: 'pts', data: rows, getPosition: (r) => [r.lon, r.lat] })]
Reference
Covered in full at the API reference.