Fix: Ensure heightmap elements are properly removed before re-insertion in editHeightmap function

This commit is contained in:
Azgaar 2026-02-26 17:51:51 +01:00
parent a276b61b2d
commit 439caced87

View file

@ -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")