Skip to content

Issue: H3HexagonLayer requires h3-js, but h3-js import via npm fails in Observable #1774

Answered by Fil
achirkunov asked this question in Q&A
Discussion options

You must be logged in to vote

This is an issue with the way Deck expects h3 to be a global (window) property, not a Framework bug.

A workaround:

```js
import * as h3 from "npm:h3-js";
window.h3 = h3;
```

```js
h3;
import deck from "npm:deck.gl";
const {Deck, DeckGL, H3HexagonLayer, HexagonLayer} = deck;
```

Note: we need two separate fenced blocks, because imports declarations are hoisted and we have to ensure that the (questionable) window.h3 = h3; runs before the deck import.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@achirkunov
Comment options

@Fil
Comment options

Answer selected by achirkunov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1773 on October 21, 2024 21:28.