Closed newmansam79 closed 3 years ago
Faced with the same problem while using APP6 sidc symbol for weather sidc - 10034500001101000000
None of the weather symbols are supported in milsymbol, you can see in the documentation what appendixes that are supported.
On 3 Feb 2021, at 14:58, Yevhenii notifications@github.com wrote:
Faced with the same problem while using APP6 sidc symbol for weather sidc - 10034500001101000000
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Most of the time milsymbol returns an upside-down question mark for symbols it does not support. However, I found at least two separate cases where nothing is rendered.
First case: For e.g.
W*A*PH----*****
(presumably valid symbol for weather / pressure systems / high pressure centre, but milsymbol does not support this, and I don't really expect it to), the question mark is neither filled nor stroked (and thus nothing is visible). Relevant code is in https://github.com/spatialillusions/milsymbol/blob/master/src/symbolfunctions/icon.js#L237:In case
this.metadata.affiliation
is"undefined"
, iconColor will beundefined
. Proposed fix: default to black or perhapsthis.colors.iconColor["Unknown"]
so at least something gets drawn.The second case occurs with e.g. totally invalid SIDC
--------------
(and many other similar strings). The relevant code is at https://github.com/spatialillusions/milsymbol/blob/master/src/symbolfunctions/icon.js#L348If the latter condition is false, nothing gets pushed to
drawArray2
(and thus nothing is drawn), andvalidIcon
remains true. Proposed fix: Check later if bothdrawArray1
anddrawArray2
are empty, and if they are, draw the question mark and set validIcon to false.