Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If 2525B is not loaded, getBasicSymbolID errors out when called with no symStd parameter #29

Closed
eric79 opened this issue Mar 15, 2018 · 2 comments
Assignees
Labels

Comments

@eric79
Copy link
Contributor

eric79 commented Mar 15, 2018

... even if RendererSettings symbology standard has been set to RendererSettings.Symbology_2525C.

This is for getBasicSymbolID, defined in SymbolUtilities.js, when the scheme is S, O, or E.

Here are some options for ways I think this could be fixed:

  1. Rather than checking both standards in a for loop, check only symStd. It appears that hasUnitDef will handle the case where symStd is undefined. (This has the added benefit of simplifying the logic quite a bit).
  2. Still check standards in a for loop, but if symStd is undefined, set it to RendererSettings.getSymbologyStandard() instead of 0
  3. Inside the for loop, you could check for UnitDefTable.hasSymbolMap(symStd) before doing anything else
  4. Update the developer's guide to say that symStd is a mandatory parameter

I think that I like (1) the most, but I leave the decision to your wise judgment. 😄

michael-spinelli pushed a commit that referenced this issue Mar 16, 2018
@michael-spinelli michael-spinelli self-assigned this Mar 16, 2018
@michael-spinelli
Copy link
Contributor

I did a combination of 1-3. No for loop, setting symStd if undefined, also doing the symbolMap check in case someone sets symStd to an erroneous value.

@eric79
Copy link
Contributor Author

eric79 commented Mar 19, 2018

👍 Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants