deck.gl
deck.gl copied to clipboard
[Doc]GeoJsonLayer: TypeScript example cannot be compiled
Link
https://deck.gl/docs/api-reference/layers/geojson-layer
Description
The line
getLineColor: (f: Feature<Geometry, PropertiesType>) => { … }
in the TypeScript example cannot be compiled. The error the compiler issues is:
Type '(f: Feature<Geometry, PropertiesType>) => number[] | undefined' is not assignable to type 'Accessor<Feature<Geometry, PropertiesType>, Color> | undefined'.
Type '(f: Feature<Geometry, PropertiesType>) => number[] | undefined' is not assignable to type 'AccessorFunction<Feature<Geometry, PropertiesType>, Color>'.
Type 'number[] | undefined' is not assignable to type 'Color'.
Type 'undefined' is not assignable to type 'Color'.
(using typescript 5.7.3)