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 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-02-25 12:57:42 +00:00
parent 9724ec57f9
commit 5b6df923fc
+2 -1
View File
@@ -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