deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

[Doc]GeoJsonLayer: TypeScript example cannot be compiled

Open clo-vis opened this issue 8 months ago • 0 comments

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)

clo-vis avatar Mar 18 '25 09:03 clo-vis