Skip to content

Commit c2ba79b

Browse files
authored
[v9] Fix GoogleMapsOverlay by not clearing canvas (#8351)
1 parent 3033517 commit c2ba79b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

modules/core/src/passes/layers-pass.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default class LayersPass extends Pass {
6666
viewport: [0, 0, width, height]
6767
},
6868
// clear depth and color buffers, restoring transparency
69-
clearColor: options.clearColor || (options.clearCanvas ? [0, 0, 0, 0] : undefined),
69+
clearColor: options.clearColor ?? (options.clearCanvas ? [0, 0, 0, 0] : false),
7070
clearDepth: options.clearCanvas ? 1 : undefined
7171
});
7272

@@ -85,8 +85,7 @@ export default class LayersPass extends Pass {
8585
viewports,
8686
views,
8787
onViewportActive,
88-
clearStack = true,
89-
clearCanvas = true
88+
clearStack = true
9089
} = options;
9190
options.pass = options.pass || 'unknown';
9291

modules/google-maps/src/google-maps-overlay.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,11 @@ export default class GoogleMapsOverlay {
242242
// @ts-expect-error
243243
deck.setProps({_framebuffer});
244244

245+
// With external gl context, animation loop doesn't resize webgl-canvas and thus fails to
246+
// calculate corrext pixel ratio. Force this manually.
247+
// @ts-expect-error
248+
deck.device.canvasContext.resize();
249+
245250
// Camera changed, will trigger a map repaint right after this
246251
// Clear any change flag triggered by setting viewState so that deck does not request
247252
// a second repaint

0 commit comments

Comments
 (0)