Fix dot when scrolling

This commit is contained in:
ReiMerc 2023-02-08 12:18:48 +01:00
parent 017377da1b
commit 68d3d08ce5
2 changed files with 3 additions and 3 deletions

View File

@ -69,8 +69,8 @@ function displayZipCode(
const position = convertCoordinateToPixels(center, mapSize); const position = convertCoordinateToPixels(center, mapSize);
const rect = document.getElementById("map")!.getBoundingClientRect(); const rect = document.getElementById("map")!.getBoundingClientRect();
dot.style.display = "block"; dot.style.display = "block";
dot.style.left = (position.x + rect.left) + "px"; dot.style.left = position.x + rect.left + "px";
dot.style.top = (position.y + rect.top) + "px"; dot.style.top = position.y + rect.top + document.documentElement.scrollTop + "px";
} }
function setupMap( function setupMap(

View File

@ -187,7 +187,7 @@ code {
border: 2px solid black; border: 2px solid black;
background-color: var(--brand); background-color: var(--brand);
filter: drop-shadow(1px 1px 2px black); filter: drop-shadow(1px 1px 2px black);
position: fixed; position: absolute;
display: none; display: none;
} }