Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 of 7 tasks
josh-taylor opened this issue Oct 11, 2024 · 0 comments
Open
2 of 7 tasks
Labels

Comments

@josh-taylor
Copy link

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 #8250 (comment))

Flavors

  • Script tag
  • React
  • Python/Jupyter notebook
  • 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant