Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Cannot dynamically alternate between terrain ON/OFF #8450

Open
1 of 7 tasks
Tracked by #8541
ssaornil opened this issue Jan 25, 2024 · 1 comment
Open
1 of 7 tasks
Tracked by #8541

[Bug] Cannot dynamically alternate between terrain ON/OFF #8450

ssaornil opened this issue Jan 25, 2024 · 1 comment
Labels

Comments

@ssaornil
Copy link

Description

We are attempting to alternate dynamically between two modes of visualization, one with terrain ON and another one with terrain OFF.

We are using mapbox as our base map and we are adding some content using the MapboxOverlay in non-interleaved mode.
We are using the TerrainLayer and the experimental TerrainExtension to "drape" the content to the terrain.

Regardless of the fact that mapbox and deck do not match completely (we are aware of that and we are disregarding that issue at the moment), we are unable to alternate between those two modes of terrain ON/OFF.

Flavors

  • Script tag
  • React
  • Python/Jupyter notebook
  • MapboxOverlay
  • GoogleMapsOverlay
  • CartoLayer
  • ArcGIS

Expected Behavior

We would expect to be able to switch between terrain ON/OFF using one of the following approaches or a combination of them:

  1. Toggle TerrainLayer visibility
  2. Adding/removing TerrainLayer
  3. Adding/removing TerrainExtension from the layers (either by redefining the layers or by cloning them)

Steps to Reproduce

Demo

In the above DEMO we are displaying the same content with mapbox and deck (using different styles). And there is a button to toggle between Terrain ON/OFF modes.

The deck layers are not visible when trying to start in the "Terrain ON" mode. START_WITH_TERRAIN= true . Alternating does nothing.

The deck content is not draped and it is also cropped when starting in the Terrain OFF mode and alternating to Terrain ON mode.

Environment

  • Framework version: deck.gl@8.9.34
  • Browser: Chrome 120.0
  • OS: Ubuntu 22.04.3 LTS

Logs

No response

@ssaornil ssaornil added the bug label Jan 25, 2024
@ssaornil
Copy link
Author

ssaornil commented Feb 2, 2024

We found an alternative that works.

Adding/removing the TerrainLayer and replacing the layers by clones with or without the TerrainExtension does not work, but if we create a new MapboxOverlay instance and use it to replace the previous one when toggling between terrain ON/OFF, then it works.

Here is a working demo.

I haven't found any place in the documentation that makes is clear that we cannot change extensions once the overlay instance is created. Maybe it would make sense to add it somewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant