-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
bundle.ts
30 lines (27 loc) · 1.17 KB
/
bundle.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import {H3HexagonLayer} from '@deck.gl/geo-layers';
export * from '../core/bundle';
export * from '@deck.gl/layers';
export * from '@deck.gl/aggregation-layers';
export * from '@deck.gl/extensions';
export * from '@deck.gl/geo-layers';
export * from '@deck.gl/google-maps';
export * from '@deck.gl/mesh-layers';
export * from '@deck.gl/mapbox';
export * from '@deck.gl/widgets';
/* eslint-disable import/no-extraneous-dependencies */
/** h3-js is not bundled due to webpack's externals config
* This will resolve to undefined unless h3-js is included via script tag
*/
import * as h3 from 'h3-js';
/* eslint-disable import/namespace */
// Check for H3 library. In the standalone bundle, h3-js is not included (see `scripts/bundle.config.js`)
H3HexagonLayer._checkH3Lib = () => {
const installHelp =
'include the <script src="https://unpkg.com/h3-js@^4.0.0"></script> tag before the deck.gl script tag. https://deck.gl/docs/api-reference/geo-layers/h3-hexagon-layer';
if (!h3) {
throw new Error(`To use H3 functionality, ${installHelp}`);
// @ts-ignore
} else if (h3.polyfill && !h3.polygonToCells) {
throw new Error(`Incompatible h3-js version. ${installHelp}`);
}
};