diff --git a/js/main.js b/js/main.js index 87bfa17..66a835d 100644 --- a/js/main.js +++ b/js/main.js @@ -115,9 +115,6 @@ class App { this.sceneManager = null; } - // 重置2D地图初始化标志 - this.is2DInitialized = false; - // 重置UI状态 this.canvasContainer.style.display = 'block'; this.speedLines.style.display = 'block'; @@ -126,7 +123,7 @@ class App { this.mapInterface.style.display = 'none'; this.mapInterface.style.opacity = '0'; - // 重置UI层和提示文字的状态(关键修复) + // 重置UI层和提示文字的状态(确保第二次进入时能正常显示) this.uiLayer.style.opacity = '0'; this.uiLayer.style.display = 'flex'; this.hint.style.opacity = '0'; @@ -170,6 +167,10 @@ class App { this.canvasContainer.style.display = 'none'; this.speedLines.style.display = 'none'; + // 隐藏3D场景的UI元素(关键修复) + this.uiLayer.style.display = 'none'; + this.hint.style.display = 'none'; + // 先显示地图容器(opacity: 0,但display: block) this.mapInterface.style.display = 'block'; this.mapInterface.style.opacity = '0';