From 5b6df923fc99f3fa61446a88ade9a4f0ecf7c0e2 Mon Sep 17 00:00:00 2001 From: Smittix Date: Wed, 25 Feb 2026 12:57:42 +0000 Subject: [PATCH] Fix APRS map centering at [0,0] when GPS unavailable Number(null) evaluates to 0 which passes Number.isFinite(), causing aprsHasValidCoordinates(null, null) to return true. This made initAprsMap() center the map at [0,0] (Gulf of Guinea) at zoom 8 instead of the US default, hiding all station markers off-screen. Add null guards (lat != null && lon != null) to reject null/undefined while still accepting 0 as a valid equator coordinate. Co-Authored-By: Claude Opus 4.6 --- templates/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/index.html b/templates/index.html index 9274460..e323d99 100644 --- a/templates/index.html +++ b/templates/index.html @@ -9299,7 +9299,8 @@ } function aprsHasValidCoordinates(lat, lon) { - return Number.isFinite(Number(lat)) && Number.isFinite(Number(lon)); + return lat != null && lon != null && + Number.isFinite(Number(lat)) && Number.isFinite(Number(lon)); } // Update APRS user location from GPS