From 8340064f23826843ac19aa66739a3c7f06e1ae56 Mon Sep 17 00:00:00 2001 From: Daniel Nagel Date: Tue, 2 Sep 2025 09:18:48 +0200 Subject: [PATCH] index.html aktualisiert --- index.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/index.html b/index.html index b6156d9..1de17d0 100644 --- a/index.html +++ b/index.html @@ -107,6 +107,23 @@ } }); + // === check URL hash === +// Format: #X,Y,Z (z.B. #22884,8249,5) +const hash = window.location.hash.slice(1).split(','); +if (hash.length >= 2) { + const x = parseFloat(hash[0]); + const y = parseFloat(hash[1]); + const z = hash.length >= 3 ? parseInt(hash[2]) : 5; + if (!isNaN(x) && !isNaN(y)) { + map.setView([y, x], isNaN(z) ? 5 : z); + // optional: Marker an Position setzen + L.marker([y, x]) + .addTo(map) + .bindPopup(`X: ${x}, Y: ${y}`) + .openPopup(); + } +} + new CenteredTiles({ tileSize: TILE, noWrap: true,