From e2e9dc7dac03e7740139e727adadb7797423ba4c Mon Sep 17 00:00:00 2001 From: Chris Gervang Date: Tue, 27 Feb 2024 15:00:19 -0800 Subject: [PATCH] chore(mapbox) use props.device instead of props.gl Signed-off-by: Chris Gervang --- modules/mapbox/src/deck-utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/mapbox/src/deck-utils.ts b/modules/mapbox/src/deck-utils.ts index abef63439cd..9cd34b83d74 100644 --- a/modules/mapbox/src/deck-utils.ts +++ b/modules/mapbox/src/deck-utils.ts @@ -1,5 +1,6 @@ import {Deck, WebMercatorViewport, MapView, _flatten as flatten} from '@deck.gl/core'; import type {DeckProps, MapViewState, Layer} from '@deck.gl/core'; +import {WebGLDevice} from '@luma.gl/webgl'; import type MapboxLayer from './mapbox-layer'; import type {Map} from 'mapbox-gl'; @@ -50,7 +51,7 @@ export function getDeckInstance({ let deckInstance: Deck; - if (!deck || deck.props.gl === gl) { + if (!deck || (deck.props.device instanceof WebGLDevice && deck.props.device.gl === gl)) { // If deck isn't defined (Internal MapboxLayer use case), // or if deck is defined and is using the WebGLContext created by mapbox (MapboxOverlay and External MapboxLayer use case), // block deck from setting the canvas size, and use the map's viewState to drive deck.