Fix duplicate heightmap overlay cleanup on editor enter and exit

Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-02-26 14:59:05 +00:00
parent b218240564
commit edcde496cf

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,7 @@ function editHeightmap(options) {
// restore initial layers
drawFeatures();
byId("heights").remove();
viewbox.selectAll("#heights").remove();
turnButtonOff("toggleHeight");
document
.getElementById("mapLayers")