From ef9997939e9bf4aec386eb493972066e57bef648 Mon Sep 17 00:00:00 2001 From: user01 Date: Mon, 25 May 2026 01:39:32 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B9=B4=EB=93=9C=20=ED=81=B4=EB=A6=AD=20?= =?UTF-8?q?=EC=8B=9C=20panTo=20+=20autoPan=3Dfalse=EB=A1=9C=20=EC=A7=80?= =?UTF-8?q?=EB=8F=84=20=EC=A4=91=EC=95=99=20=EC=A0=95=EB=A0=AC=20=EA=B0=9C?= =?UTF-8?q?=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/index.html | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/templates/index.html b/templates/index.html index 61d19ad..392a434 100644 --- a/templates/index.html +++ b/templates/index.html @@ -658,7 +658,7 @@ function renderWorkplaceMarkers() { ${escHtml(g.address)} ${g.ids.length > 1 ? `
(${g.ids.length}개 투표소)
` : ''} ${getGroupAssigneesHtml(g.ids)} - `); + `, {autoPan: false}); markers.workplaces[g.address] = marker; bounds.push([g.lat, g.lng]); } @@ -680,7 +680,7 @@ function renderWorkerMarkers() { for (const w of d.workers) { const isAssigned = d.assignments[w.id]; const marker = L.marker(getWorkerPos(w), { icon: isAssigned ? WORKER_ASSIGNED_ICON : WORKER_ICON, draggable: true }) - .addTo(map).bindPopup(buildWorkerPopup(w.id)); + .addTo(map).bindPopup(buildWorkerPopup(w.id), {autoPan: false}); marker.on('dragend', function () { handleWorkerDragEnd(w.id, this); }); markers.workers[w.id] = marker; } @@ -783,8 +783,10 @@ function renderWorkerList() { `; card.addEventListener('click', () => { const pos = getWorkerPos(w); - map.setView(pos, 16); - if (markers.workers[w.id]) markers.workers[w.id].openPopup(); + map.panTo(pos, {animate: true, duration: 0.3}); + setTimeout(() => { + if (markers.workers[w.id]) markers.workers[w.id].openPopup(); + }, 350); }); card.addEventListener('dragstart', e => { e.dataTransfer.setData('text/plain', w.id); e.dataTransfer.effectAllowed = 'move'; card.classList.add('dragging'); }); card.addEventListener('dragend', () => card.classList.remove('dragging')); @@ -851,8 +853,10 @@ function renderWorkplaceList() { `; card.addEventListener('click', () => { - map.setView([g.lat, g.lng], 16); - if (markers.workplaces[g.address]) markers.workplaces[g.address].openPopup(); + map.panTo([g.lat, g.lng], {animate: true, duration: 0.3}); + setTimeout(() => { + if (markers.workplaces[g.address]) markers.workplaces[g.address].openPopup(); + }, 350); }); list.appendChild(card); }