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

loadStyle method doesn't check style validity #4

Closed
jjhembd opened this issue Jun 25, 2021 · 1 comment
Closed

loadStyle method doesn't check style validity #4

jjhembd opened this issue Jun 25, 2021 · 1 comment

Comments

@jjhembd
Copy link
Collaborator

jjhembd commented Jun 25, 2021

The loadStyle method doesn't check the style at all. We need to confirm:

  • If a link is supplied, is the linked document valid JSON?
  • Does it follow the style specification?

Even for an invalid JSON, the error is not captured and returned

@jjhembd
Copy link
Collaborator Author

jjhembd commented Jun 30, 2021

This is mostly addressed by 1d589f7. The Promise returned by the loadStyle method will reject in any of the following cases:

  • Invalid URL
  • HTTP errors
  • JSON parsing error
  • Style document is missing a required root property (version, sources, layers)

I think this is enough to resolve the issue for now. We might in the future want to add more detailed checks of the style against the specification.

Note: this does NOT resolve the relevant point in GlobeletJS/GlobeletJS#1, because the errors are not yet neatly passed through tile-setter

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