You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The input string is not a mgrs string so it's expected that mgrs would fail to parse it. But could the library fail in a more obvious way, such as returning undefined or throwing an error?
Our company got bitten by this, since we were using mgrs to detect whether a string was mgrs. We have a search field where the user can enter latlon coordinates, mgrs, and place names, and so our code tries to detect whether a string is mgrs. Unfortunately, we considered an array return value to be a successful parse. We now have code to check for the NaNs. Should this failure case be improved?
Thanks.
The text was updated successfully, but these errors were encountered:
Hi, @matthias-ccri . That's a great suggestion! Would you like to work on a contribution and submit a Pull Request? If not, I can try to get to it, but I can't promise that would happen soon.
Calling
mgrs.inverse('1fcd3c38-ef3d-462d-8fd4-6191bde89736')
returns[NaN, NaN, NaN, NaN]
.The input string is not a mgrs string so it's expected that mgrs would fail to parse it. But could the library fail in a more obvious way, such as returning
undefined
or throwing an error?Our company got bitten by this, since we were using mgrs to detect whether a string was mgrs. We have a search field where the user can enter latlon coordinates, mgrs, and place names, and so our code tries to detect whether a string is mgrs. Unfortunately, we considered an array return value to be a successful parse. We now have code to check for the NaNs. Should this failure case be improved?
Thanks.
The text was updated successfully, but these errors were encountered: