Unlimited Restricted Airspace Displayed as FLNaN
Fechulo opened this issue · 8 comments
@Fechulo @erikquinn That is because it's trying to parse a string 'Unlimited' which is obviously, not a number.
This should, hopefully, be an easy fix. Should it display FL UNL
or just UNL
?
never mind, I found it.
@Fechulo is this the first you noticed this issue? From what I can tell, this much have been an issue for quite a while. Oh well, it's going to be addressed for v3.2.0.
@n8rzz I believe it should just display 'UNL'. This was definitely working before v3 but I'm not sure when it stopped working. There's very few airports in the game that have restricted airspace with an unlimited ceiling, so I found it today while working on El Paso Intl.
@Fechulo right on, I think there were two airports that came up when I searched. I'm sure I got a little jumpy refactoring and something was missed. In fact, thats my assumption here.
Good news is that there are now specific tests for this case, so once the bugfix is completed we will know that this case is covered with tests.
@n8rzz does Infinity
parse properly as a number? Perhaps using that in the file instead of unlimited
would yield an equally acceptable result without necessitating complications to the logic for this one case? Either way. I do agree with @Fechulo though, definitely UNL
of the two or 999
or 600
(the top of controlled airspace is more of less considered to be FL600, where the jet airways are no longer usable).
@erikquinn parseFloat(Infinity)
will output Infinity
. The problem here, is that infinity is being passed as a string and not a number (Infinity is a number in javascript):
parseFloat(Infinity) -> Infinity
parseFloat('Infinity') -> NaN
As far the FL and the UNL, that is already implemented within the CanvasController
but because the height value is NaN
by the time it gets there, the ternary thinks is supposed to be a FL
.
const height = (area.height === Infinity ? 'UNL' : 'FL' + Math.ceil(area.height / 1000) * 10);