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

Cannot read property 'center' of undefined #129

Open
elsehow opened this issue May 27, 2021 · 1 comment
Open

Cannot read property 'center' of undefined #129

elsehow opened this issue May 27, 2021 · 1 comment

Comments

@elsehow
Copy link

elsehow commented May 27, 2021

When I load in some data I constructed (gist), I get an error.

gio.min.js:2 Uncaught TypeError: Cannot read property 'center' of undefined
    at C (gio.min.js:2)
    at gio.min.js:2
    at Object.v [as createGeometry] (gio.min.js:2)
    at P.processDetail (gio.min.js:4)
    at P.a.process (gio.min.js:4)
    at q.a.process (gio.min.js:4)
    at D.a.process (gio.min.js:4)
    at V.a.process (gio.min.js:4)
    at l.a.process (gio.min.js:4)
    at o (gio.min.js:2)

My strong suspicion is that one or more of the Alpha2 codes I passed in is unrecognized. But this error message doesn't tell me which one.

Does anyone happen to know what this error message tends to mean in giojs?

@elsehow
Copy link
Author

elsehow commented May 27, 2021

I hackily resolved my problem by taking the sample data in examples/data/sampleData.json and doing a set difference with the ISO Alpha2 codes in that file vs the ISO Alpha2 codes in mine.

The unsupported Alpha2s were:

{'CC', 'EU', 'HK', 'MO', 'SX'}

My suggestion: When an Alpha2 isn't recognized, throw an error like:

Alpha2 code 'EU' not found in map.

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

No branches or pull requests

1 participant