Description
When closing a Story in the Stories tool, the map visually reloads (globe zoom, layers re-streaming) even when the story never adds, removes, or hides any layers itself.
Cause
In StoryView.svelte, hideAllLayers() is called unconditionally in onMount, and removeAllLayers() / restoreStartLayerState() are called unconditionally in resetToStart() (on destroy). This hides all currently visible map layers when opening any story, and re-shows them when closing it — even for stories where every step has an empty layers array and never touches the map.
Re-showing previously hidden layers can trigger Cesium to re-stream/reload tiles, which looks like a full map reset to the user, even though nothing about the map actually needed to change.
Steps to reproduce
- Configure a story where all steps have
"layers": [] (info/HTML-only story).
- Open the story, then close it.
- Observe the map reloads/reruns tile loading, even though no layer state should have changed.
Proposed fix
Compute whether the story defines any layers at all (hasStoryLayers), and only call the layer hide/restore logic when that's true. Terrain provider and globe opacity resets are left unconditional since they are safe no-ops when unchanged.
Description
When closing a Story in the Stories tool, the map visually reloads (globe zoom, layers re-streaming) even when the story never adds, removes, or hides any layers itself.
Cause
In
StoryView.svelte,hideAllLayers()is called unconditionally inonMount, andremoveAllLayers()/restoreStartLayerState()are called unconditionally inresetToStart()(on destroy). This hides all currently visible map layers when opening any story, and re-shows them when closing it — even for stories where every step has an emptylayersarray and never touches the map.Re-showing previously hidden layers can trigger Cesium to re-stream/reload tiles, which looks like a full map reset to the user, even though nothing about the map actually needed to change.
Steps to reproduce
"layers": [](info/HTML-only story).Proposed fix
Compute whether the story defines any layers at all (
hasStoryLayers), and only call the layer hide/restore logic when that's true. Terrain provider and globe opacity resets are left unconditional since they are safe no-ops when unchanged.