diff --git a/index.html b/index.html index 8eb8d2c2..ad63aba3 100644 --- a/index.html +++ b/index.html @@ -3513,6 +3513,7 @@ + diff --git a/modules/ui/burg-editor.js b/modules/ui/burg-editor.js index 94145e13..2275f4a1 100644 --- a/modules/ui/burg-editor.js +++ b/modules/ui/burg-editor.js @@ -47,6 +47,7 @@ function editBurg(id) { byId("burgEmblem").addEventListener("click", openEmblemEdit); byId("burgTogglePreview").addEventListener("click", toggleBurgPreview); byId("burgEditEmblem").addEventListener("click", openEmblemEdit); + byId("burgLocate").addEventListener("click", zoomIntoBurg); byId("burgRelocate").addEventListener("click", toggleRelocateBurg); byId("burglLegend").addEventListener("click", editBurgLegend); byId("burgLock").addEventListener("click", toggleBurgLockButton); @@ -397,6 +398,14 @@ function editBurg(id) { byId("burgTogglePreview").className = options.showBurgPreview ? "icon-map" : "icon-map-o"; } + function zoomIntoBurg() { + const id = elSelected.attr("data-id"); + const label = document.querySelector("#burgLabels [data-id='" + id + "']"); + const x = +label.getAttribute("x"); + const y = +label.getAttribute("y"); + zoomTo(x, y, 8, 2000); + } + function toggleRelocateBurg() { const toggler = byId("toggleCells"); byId("burgRelocate").classList.toggle("pressed");