From 439caced87d4e05d89db707c21f01e2857a38c2c Mon Sep 17 00:00:00 2001 From: Azgaar Date: Thu, 26 Feb 2026 17:51:51 +0100 Subject: [PATCH] Fix: Ensure heightmap elements are properly removed before re-insertion in editHeightmap function --- public/modules/ui/heightmap-editor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/modules/ui/heightmap-editor.js b/public/modules/ui/heightmap-editor.js index 8d9a453f..69be5059 100644 --- a/public/modules/ui/heightmap-editor.js +++ b/public/modules/ui/heightmap-editor.js @@ -3,6 +3,7 @@ function editHeightmap(options) { const {mode, tool} = options || {}; restartHistory(); + viewbox.selectAll("#heights").remove(); viewbox.insert("g", "#terrs").attr("id", "heights"); if (!mode) showModeDialog(); @@ -188,7 +189,8 @@ function editHeightmap(options) { // restore initial layers drawFeatures(); - byId("heights").remove(); + viewbox.selectAll("#heights").remove(); + turnButtonOff("toggleHeight"); document .getElementById("mapLayers")