From b7a53e9912e1c18e5675a06a3e556c634fde64e9 Mon Sep 17 00:00:00 2001 From: Eskimue Date: Thu, 2 Apr 2026 15:53:32 +0200 Subject: [PATCH] Geocron leicht verbessert --- public/geocron/index.php | 12 ++++++++++++ public/geocron/plugin-markers.js | 22 +++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/public/geocron/index.php b/public/geocron/index.php index 1f72634..7354850 100644 --- a/public/geocron/index.php +++ b/public/geocron/index.php @@ -22,6 +22,18 @@ require __DIR__ . '/../header.php'; + diff --git a/public/geocron/plugin-markers.js b/public/geocron/plugin-markers.js index 45c3995..b0d5893 100644 --- a/public/geocron/plugin-markers.js +++ b/public/geocron/plugin-markers.js @@ -11,10 +11,30 @@ (function () { + const userLocation = window.GeocronUserLocation; + const userLocationMarker = userLocation + && Number.isFinite(Number(userLocation.latitude)) + && Number.isFinite(Number(userLocation.longitude)) + ? { + name: userLocation.name || "Dein Standort", + lat: Number(userLocation.latitude), + lon: Number(userLocation.longitude), + color: "rgba(255, 215, 90, 0.98)", + glow: "rgba(255, 215, 90, 0.75)", + radius: 6, + showLabel: true, + popup: `${userLocation.name || "Dein Standort"}\n${Number(userLocation.latitude).toFixed(4)}° / ${Number(userLocation.longitude).toFixed(4)}°` + + (userLocation.elevation !== null && userLocation.elevation !== undefined + ? `\n${Number(userLocation.elevation).toFixed(0)} m` + : ""), + } + : null; + // ═══════════════════════════════════════════════════════════════ // MARKER-LISTE – hier eintragen // ═══════════════════════════════════════════════════════════════ const MARKERS = [ + ...(userLocationMarker ? [userLocationMarker] : []), // ═══════════════════════════════════════════════════════════ // EIGENE STANDORTE @@ -28,7 +48,7 @@ iconW: 67, iconH: 45, showLabel: false, - popup: "Astronomiemuseum\nSternwarte Rodewisch", + popup: "Astronomiemuseum\nSternwarte Sonneberg", }, {