Created
July 3, 2026 23:54
-
-
Save chrisgervang/187e6948e5170b630de480340147c975 to your computer and use it in GitHub Desktop.
InfoWidget hover bug repro - deck.gl 9.3.6 (tooltip computed but not rendered on hover)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <title>InfoWidget Hover Test - deck.gl 9.3.6</title> | |
| <script src="https://unpkg.com/maplibre-gl@5.0.0/dist/maplibre-gl.js"></script> | |
| <link rel="stylesheet" href="https://unpkg.com/maplibre-gl@5.0.0/dist/maplibre-gl.css" /> | |
| <script src="https://unpkg.com/deck.gl@9.3.6/dist.min.js"></script> | |
| <link rel="stylesheet" href="https://unpkg.com/@deck.gl/widgets@9.3.6/dist/stylesheet.css" /> | |
| <style> | |
| body { margin: 0; } | |
| #map { width: 100vw; height: 100vh; } | |
| </style> | |
| </head> | |
| <body> | |
| <div id="map"></div> | |
| <script> | |
| const {Deck, MapView} = globalThis.deck; | |
| const {GeoJsonLayer} = globalThis.deck; | |
| const {InfoWidget} = globalThis.deck; | |
| const deckgl = new Deck({ | |
| parent: document.getElementById('map'), | |
| views: new MapView({controller: true}), | |
| initialViewState: { | |
| longitude: -0.45, | |
| latitude: 51.47, | |
| zoom: 4 | |
| }, | |
| mapStyle: 'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json', | |
| layers: [ | |
| new GeoJsonLayer({ | |
| id: 'airports', | |
| data: 'https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_10m_airports.geojson', | |
| filled: true, | |
| getFillColor: [200, 0, 80, 180], | |
| pointRadiusMinPixels: 5, | |
| pickable: true | |
| }) | |
| ], | |
| widgets: [ | |
| new InfoWidget({ | |
| mode: 'hover', | |
| getTooltip: (info) => { | |
| if (info.object) { | |
| const name = info.object.properties?.name || 'Unknown'; | |
| console.log('getTooltip called:', name); | |
| return name; | |
| } | |
| return null; | |
| } | |
| }) | |
| ] | |
| }); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment