From 1a1ad16d12d456dccd384a88c4d17b6bf8b53890 Mon Sep 17 00:00:00 2001 From: Joachim Hummel Date: Fri, 14 Nov 2025 15:42:50 +0000 Subject: [PATCH] Fix latitude/longitude string parsing in index_owntrack.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Convert string latitude/longitude to float before using in Leaflet - NocoDB returns coordinates as strings, causing Leaflet errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- index_owntrack.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/index_owntrack.html b/index_owntrack.html index 1bfa18a..99c005f 100644 --- a/index_owntrack.html +++ b/index_owntrack.html @@ -127,18 +127,21 @@ popupContent += `
🚗 Speed: ${speedKmh} km/h`; } - const marker = L.marker([loc.latitude, loc.longitude]) + const lat = parseFloat(loc.latitude); + const lon = parseFloat(loc.longitude); + + const marker = L.marker([lat, lon]) .addTo(map) .bindPopup(popupContent) .openPopup(); markers.push(marker); - map.setView([loc.latitude, loc.longitude], 15); + map.setView([lat, lon], 15); // Historie als Linie if (data.history && data.history.length > 1) { - const coords = data.history.map(h => [h.latitude, h.longitude]); + const coords = data.history.map(h => [parseFloat(h.latitude), parseFloat(h.longitude)]); const polyline = L.polyline(coords, {color: 'blue', weight: 3}).addTo(map); polylines.push(polyline); }