visgl / visgl/deck.gl

[Bug] Subsequent `GoogleMapsOverlays` fail to render after an overlay has been added then removed when `interleaved=true`

Open
#10,059 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
14.6k
Forks
2.3k
Avg merge
2d 9h
Merged PRs (30d)
42

Description

Description

I've got an app where you can toggle a heatmap on and off, it's not on by default - I've got a component which is functionally identical to the DeckGLOverlay one in https://deck.gl/docs/api-reference/google-maps/google-maps-overlay

Which works fine when interleaved=false but when it's true the second GoogleMapsOverlay will never render.

I've tried calling overlay.finalize() instead of & in addition to overlay.setMap(null) with no change.

There's no error logged to the console & debugging shows that a new GoogleMapsOverlay is being created is getting .setMap called on it properly.

Flavors
  • Script tag
  • React
  • Python/Jupyter notebook
  • MapboxOverlay
  • GoogleMapsOverlay
  • CARTO
  • ArcGIS
Expected Behavior

I'd expect interleaved=true to behave like interleaved=false is, in that the DeckGLOverlay component can be removed from the map then re-added and still work.

Steps to Reproduce

I don't think there's a codepen for https://deck.gl/docs/api-reference/google-maps/google-maps-overlay, but modifying it so the DeckGLOverlay component is rendered conditionally based on a toggle should be enough to cause the issue & see it happening.

Environment
  • Framework version:
    "deck.gl": "^9.2.10",
    "@deck.gl/google-maps": "^9.2.10",
  • Browser: Chrome v145
  • OS: MacOS 26.3
Logs

N/A - no errors

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by modifying the GoogleMapsOverlay documentation example so the DeckGLOverlay is conditionally rendered by a toggle, then compare its behavior with interleaved=false. The issue is fixed when removing and re-adding the overlay with interleaved=true renders it again without errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.