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

getText accessor function parameter not typed in GeoJsonLayer

Open Fabioni opened this issue 1 year ago • 0 comments

Description

The parameter for the getText accessor is not typed.

Flavors

  • [ ] Script tag
  • [ ] React
  • [ ] Python/Jupyter notebook
  • [ ] MapboxOverlay
  • [ ] GoogleMapsOverlay
  • [ ] CartoLayer
  • [ ] ArcGIS

Expected Behavior

In getText: (f) => ... f should have type Feature<Geometry, PropertiesType>

Steps to Reproduce

https://stackblitz.com/edit/vitejs-vite-musbxe?file=main.ts

const layer = new GeoJsonLayer<PropertiesType>({
    id: 'GeoJsonLayer',
    data: 'https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/bart.geo.json',
    pointType: 'circle+text',
    // getText: (f: Feature<Geometry, PropertiesType>) => f.properties.name,
    getText: (f) => f.properties.name, // f should automatically have the correct type
    getFillColor: (f) => [0, 0, 0], // f automatically has the correct type
  });

Environment

  • Framework version: 9.0.21

Logs

No response

Fabioni avatar Jul 12 '24 00:07 Fabioni