Decode APRS station symbols and improve map centering
Render local APRS symbol sprites with table and overlay details while preserving markers and open popups during refresh. Open the map around the local station with a 30 km radius and fit the densest station group without distant outliers. Add localization, attribution and regression coverage.
This commit is contained in:
1 parent
2ef3c25eb3
commit
8ee4e9636a
14 files changed
+605
-21
No files matched your search
@@ -0,0 +1,13 @@
|
||||
// APRS table identifiers and BPQ's row/column icon keys (APRSCode.c).
|
||||
export function aprsSymbol(symset,symbol){
|
||||
if(typeof symbol!=='string'||symbol.length!==1||symbol<'!'||symbol>'~'||!/^[/\\A-Z0-9]$/.test(symset||''))return null;
|
||||
return {symbol,symset,table:symset==='/'?'primary':'alternate',overlay:/^[A-Z0-9]$/.test(symset)?symset:null};
|
||||
}
|
||||
export function nativeSymbol(key){
|
||||
if(!/^[0-9a-f]{4}[@A-Z0-9]$/i.test(key||''))return null;
|
||||
const row=parseInt(key.slice(0,2),16),col=parseInt(key.slice(2,4),16);
|
||||
if(row>11||col>15)return null;
|
||||
const index=(row%6)*16+col;if(index>93)return null;
|
||||
const overlay=key[4]==='@'?null:key[4];if(overlay&&row<6)return null;
|
||||
return aprsSymbol(overlay||(row<6?'/':'\\'),String.fromCharCode(33+index));
|
||||
}
|
||||
Reference in new issue
Block a user