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

[Bug] TypeScript error when using MapboxOverlay with "react-map-gl/maplibre"

Open josh-taylor opened this issue 1 year ago • 0 comments

Description

I am getting the following error from TypeScript when using useControl from react-map-gl/maplibre and MapboxOverlay when following the documentation.

Type 'MapboxOverlay' does not satisfy the constraint 'IControl<MapInstance>'.
  Types of property 'onAdd' are incompatible.
    Type '(map: Map$1) => HTMLDivElement' is not assignable to type '(map: MapInstance) => HTMLElement'.
      Types of parameters 'map' and 'map' are incompatible.
        Type 'MapInstance' is missing the following properties from type 'Map$1': style, painter, _container, _missingCSSCanary, and 245 more.ts(2344)

(I spotted that somebody else has a similar issue in https://github.com/visgl/deck.gl/issues/8250#issuecomment-2264582777)

Flavors

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

Expected Behavior

No TypeScript error when using useControl with the MapboxOverlay. Or maybe we need something like MaplibreOverlay?

Steps to Reproduce

Build the example that is in the documenation.

Environment

  • Framework version: 9.0.33
  • Browser: N/A
  • OS: macOS 14.6.1

Logs

No response

josh-taylor avatar Oct 11 '24 09:10 josh-taylor