leaflet ยท console.warn
bindLeaflet: options.layers is not a functio...
Printed by leaflet, prefixed [lattice], since 1.76.0.
Warnings reference › leaflet:layers
- Identifier
leaflet:layers- Raised by
- leaflet
- Since
- 1.76.0
What happened
The module imports nothing of Leaflet's, so it cannot build a layer itself: the page supplies a function that turns the grid's rows (or ctx.features) into Leaflet layers with its own L. 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) => [L.geoJSON(ctx.features)]
Reference
Covered in full at the API reference.