maplibre-gl
Version:
BSD licensed community fork of mapbox-gl, a WebGL interactive maps library
12 lines (9 loc) • 376 B
text/typescript
let supportsOffscreenCanvas: boolean;
export default function offscreenCanvasSupported(): boolean {
if (supportsOffscreenCanvas == null) {
supportsOffscreenCanvas = typeof OffscreenCanvas !== 'undefined' &&
new OffscreenCanvas(1, 1).getContext('2d') &&
typeof createImageBitmap === 'function';
}
return supportsOffscreenCanvas;
}