mirror of
https://github.com/smittix/intercept.git
synced 2026-06-08 14:11:54 -07:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user