fix(google-maps): Robust DOM positioning when interleaved: false#9992
Open
felixpalmer wants to merge 24 commits intomasterfrom
Open
fix(google-maps): Robust DOM positioning when interleaved: false#9992felixpalmer wants to merge 24 commits intomasterfrom
felixpalmer wants to merge 24 commits intomasterfrom
Conversation
chrisgervang
approved these changes
Feb 10, 2026
| ...props, | ||
| useDevicePixels: props.interleaved ? true : props.useDevicePixels, | ||
| // Default to true for high-DPI displays, but allow user override | ||
| useDevicePixels: props.useDevicePixels ?? true, |
Collaborator
|
I'm unfamiliar with this Google view API. Are there any noticeable performance or billing implications that come with adding two views? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces #9985 @neil-morrison44 @chrisgervang
Background
The Google maps library has a number of rendering modes, which can be decided at runtime. At a high level we have:
RASTERold code path, uses PNG images as tilesVECTORnewer code, rendering using WebGL and vector dataIn order to integrate the deck.gl canvas we need to synchronize with the view state of the Google Map. Two classes are provided for this:
google.maps.OverlayViewandgoogle.maps.WebGLOverlayView.For the
RASTERcase, we have no choice, we must useOverlayViewas there is no WebGL context. Conceptually this integration path is simpler as we have a clear DOM element to attach to:overlay.getPanes()?.overlayLayerFor the
VECTORcase there is no DOM element, as we instead receive aWebGLContextto draw into.The complexity comes when we want to support
VECTORwithinterleaved=falseas theWebGLOverlayViewdoes not give use a DOM point to mount to. Currently we just attach to the root element, but this causes issues as the deck.gl canvas is drawn on top of the Google controls.In the
interleaved=falsecase it seems natural to use thegoogle.maps.OverlayViewinstead of thegoogle.maps.WebGLOverlayViewas we don't need access to the WebGL canvas and instead we want to cleanly add a DOM element (the deck.gl app) to the Google Maps library.The problem is that
google.maps.OverlayView.draw()is limited compared togoogle.maps.WebGLOverlayView.onDraw(). Specificallygoogle.maps.WebGLOverlayView.onDraw()provides atransformerobject which lets deck.gl exactly reconstruct the view state, and it even works during animations/transitions. There is no such API withgoogle.maps.OverlayView.draw, which leads to a glitchy integration (see the long list of commits in this PR for details)As such for the non-interleaved case, this PR both:
OverlayViewin order to position the non-interleaved canvasWebGLOverlayViewin order to obtaintransformerobject to give correct camera trackingChange List
OverlayView&WebGLOverlayViewin non-interleaved case_createOverlayVectorand_createOverlayRasteruseDevicePixelsdefault behavior in non-interleaved mode