Skip to content

[Doc]HexagonLayer: TypeScript example cannot be compiled #9512

@clo-vis

Description

@clo-vis

Link

https://deck.gl/docs/api-reference/aggregation-layers/hexagon-layer

Description

The line

getTooltip: ({object}: PickingInfo<BikeRack>) => object && `Count: ${object.elevationValue}`,

in the TypeScript example cannot be compiled. The error the compiler issues is:

Type '({ object }: HexagonLayerPickingInfo<BikeRack>) => string | undefined' is not assignable to type '(info: { color: Uint8Array<ArrayBufferLike> | null; layer: Layer<{}> | null; sourceLayer?: Layer<{}> | null | undefined; viewport?: Viewport | undefined; ... 8 more ...; pixelRatio: number; }) => TooltipContent'.
  Type 'string | undefined' is not assignable to type 'TooltipContent'.
    Type 'undefined' is not assignable to type 'TooltipContent'.ts(2322)

(using typescript 5.7.3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions