Skip to content

Commit

Permalink
Use getCanvas() in GoogleMapsOverlay (#8272)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixpalmer committed Nov 10, 2023
1 parent db3277a commit b16f515
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions modules/google-maps/src/google-maps-overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ export default class GoogleMapsOverlay {
setProps(props: Partial<GoogleMapsOverlayProps>): void {
Object.assign(this.props, props);
if (this._deck) {
if (props.style) {
// @ts-ignore accessing protected member
const parentStyle = this._deck.canvas.parentElement.style;
const canvas = this._deck.getCanvas();
if (props.style && canvas?.parentElement) {
const parentStyle = canvas.parentElement.style;
Object.assign(parentStyle, props.style);
props.style = null;
}
Expand Down Expand Up @@ -202,10 +202,12 @@ export default class GoogleMapsOverlay {
this._overlay as google.maps.OverlayView
);

// @ts-ignore accessing protected member
const parentStyle = deck.canvas.parentElement.style;
parentStyle.left = `${left}px`;
parentStyle.top = `${top}px`;
const canvas = deck.getCanvas();
if (canvas?.parentElement) {
const parentStyle = canvas.parentElement.style;
parentStyle.left = `${left}px`;
parentStyle.top = `${top}px`;
}

const altitude = 10000;
deck.setProps({
Expand Down

0 comments on commit b16f515

Please sign in to comment.