diff --git a/src/sharelink.celestial.test.mjs b/src/sharelink.celestial.test.mjs index dbfbf5fe2..5c1df1fc9 100644 --- a/src/sharelink.celestial.test.mjs +++ b/src/sharelink.celestial.test.mjs @@ -692,6 +692,7 @@ test('visual input listeners are revoked before asynchronous UI teardown', () => assert.match(synchronous, /this\._applicationShortcuts\?\.destroy\(\)/); assert.match(synchronous, /this\._visualEffects\.stop\(\)/); assert.match(synchronous, /this\._mapSourceControls\?\.destroy\(\)/); + assert.match(synchronous, /this\._clearLayersControl\?\.destroy\(\)/); assert.match(synchronous, /this\._displayControls\?\.destroy\(\)/); assert.match(synchronous, /this\._styleParameters\?\.destroy\(\)/); }); diff --git a/src/ui.js b/src/ui.js index 74c6c8386..9cee03d13 100644 --- a/src/ui.js +++ b/src/ui.js @@ -3331,7 +3331,6 @@ export class StyleManager { _initMapStackControl() { if (!this.mapStackController) return; this._mapSourceControls?.destroy(); - this._clearLayersControl?.destroy(); this._mapSourceControls = createMapSourceControls({ container: this._mapStackChips, statusElement: this._mapStackStatus,