File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -2129,10 +2129,19 @@ function setMarker(data) {
21292129 opts . staffComments = emojify ( ":flag-" + cc + ":" ) + " " + ( opts ?. staffComments || "" ) ;
21302130 data . flag = opts . country . toUpperCase ( ) + " " + emojify ( ":flag-" + cc + ":" ) ;
21312131 }
2132- if ( data . SIDC . length == 20 && opts ?. country && opts . country . length == 2 ) {
2133- data . flag = opts . country . toUpperCase ( ) + " " + emojify ( ":flag-" + opts . country . toLowerCase ( ) + ":" ) ;
2134- opts . country = data . flag ;
2132+ if ( data . SIDC . length == 12 && data ?. flag && data . flag . length == 2 ) {
2133+ opts . staffComments = emojify ( ":flag-" + data . flag . toLowerCase ( ) + ":" ) + " " + ( opts ?. staffComments || "" ) ;
21352134 }
2135+ if ( data . SIDC . length == 20 ) {
2136+ if ( opts ?. country && opts . country . length == 2 ) {
2137+ data . flag = opts . country . toUpperCase ( ) + " " + emojify ( ":flag-" + opts . country . toLowerCase ( ) + ":" ) ;
2138+ opts . country = data . flag ;
2139+ }
2140+ else if ( data ?. flag && data . flag . length == 2 ) {
2141+ opts . country = data . flag . toUpperCase ( ) + " " + emojify ( ":flag-" + data . flag . toLowerCase ( ) + ":" ) ;
2142+ }
2143+ }
2144+ console . log ( "OPTS" , opts )
21362145 data . speed = opts ?. speed || data ?. speed ; // If SIDC then options.speed can override the speed.
21372146 if ( data ?. speed && ! opts ?. direction ) { opts . direction = data ?. track || data ?. hdg || data ?. heading || data ?. COG || data ?. bearing }
21382147 if ( data . speed == undefined ) { delete data . speed ; }
You can’t perform that action at this time.
0 commit comments